/* ═══════════════════════════════════════════════════════
   Mindfrog Analytics Platform — Styles
   Aesthetic: Clean pharmaceutical research tool.
   Warm neutrals, teal accent, generous whitespace.
   ═══════════════════════════════════════════════════════ */

:root {
    /* ── Palette ────────────────────────────── */
    --bg:           #F5F5F5;
    --bg-card:      #ffffff;
    --bg-sidebar:   #404040;
    --bg-input:     #f1f0ec;
    --bg-hover:     #eeedea;
    --bg-code:      #2d3748;

    --text:         #2d2d2d;
    --text-secondary: #6b7280;
    --text-muted:   #9ca3af;
    --text-inverse: #f1f0ec;

    --accent:       #E83524;
    --accent-hover: #B82A1C;
    --accent-light: #FCEAE8;
    --accent-muted: #F07668;

    --warn:         #d97706;
    --warn-bg:      #fffbeb;
    --error:        #dc2626;
    --error-bg:     #fef2f2;
    --success:      #059669;
    --success-bg:   #ecfdf5;

    --border:       #e5e4e0;
    --border-light: #f0efeb;

    --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
    --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:    0 4px 12px rgba(0,0,0,0.07);
    --shadow-lg:    0 10px 30px rgba(0,0,0,0.08);

    --radius:       8px;
    --radius-lg:    12px;
    --radius-sm:    6px;

    /* ── Typography ────────────────────────── */
    --font:         'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'JetBrains Mono', 'Consolas', monospace;
}


/* ── Reset ────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }


/* ── Loading screen ───────────────────────────────── */

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 16px;
    color: var(--text-muted);
}

.loading-logo img {
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}


/* ═══════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════ */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(232,53,36,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(232,53,36,0.03) 0%, transparent 40%),
        var(--bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    border: 1px solid var(--border-light);
}

.login-brand {
    text-align: center;
    margin-bottom: 36px;
}

.login-brand h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text);
    margin-top: 16px;
}

.login-brand p {
    font-size: 0.87rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-error {
    background: var(--error-bg);
    color: var(--error);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    display: none;
}

.login-error.visible { display: block; }


/* ═══════════════════════════════════════════════════════
   LAYOUT — SIDEBAR + MAIN
   ═══════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.14);
}

.sidebar-brand h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    display: block;
    margin-top: 2px;
}

/* W6 §3 — sandbox badge beside the version; absent on prod (MINDFROG_ENV=prod). */
.sidebar-brand .mf-env-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.3;
    vertical-align: middle;
    color: #1a1a1a;
    background: #f5b942;
    opacity: 1;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5);
    padding: 16px 12px 6px;
    font-weight: 500;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.88);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font);
}

.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: #E83524; color: #fff; }
.nav-item.disabled { opacity: 0.3; cursor: not-allowed; }
.nav-item i { width: 18px; height: 18px; opacity: 0.7; }

.nav-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.nav-item.completed .nav-step-num {
    background: var(--accent);
    color: #fff;
}

.nav-item.active .nav-step-num { background: rgba(255,255,255,0.25); }

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.14);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-footer button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.sidebar-footer button:hover { color: #fff; background: rgba(255,255,255,0.08); }

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px 48px;
    max-width: 960px;
}


/* ═══════════════════════════════════════════════════════
   HOME / ENGINE SELECTION
   ═══════════════════════════════════════════════════════ */

.home-header {
    margin-bottom: 40px;
}

.home-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.home-header p {
    color: var(--text-secondary);
    margin-top: 6px;
    font-size: 0.95rem;
}

.engine-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.engine-card {
    background: var(--bg-card);
    border: 1px solid #C8C8C8;
    border-radius: 2px;
    padding: 36px 32px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.engine-card:hover {
    border-color: var(--accent);
}

.engine-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.engine-card:hover::before { opacity: 1; }

.engine-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 2px;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E83524;
    margin-bottom: 20px;
}

.engine-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.engine-card p {
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.engine-card-steps {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    font-size: 0.8rem;
    color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════
   HOME — TOP-LEVEL CARDS (3-card layout)
   ═══════════════════════════════════════════════════════ */

.home-cards-top {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.home-card {
    background: var(--bg-card);
    border: 1px solid #C8C8C8;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.home-card:hover {
    border-color: var(--accent);
}

.home-card-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.home-card:hover .home-card-accent { opacity: 1; }

.home-card-body {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 32px 36px;
}

.home-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 2px;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E83524;
    flex-shrink: 0;
}

.home-card-text h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.home-card-text p {
    font-size: 0.87rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.home-card-steps {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.home-card-badge {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--accent-light);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 10px;
}


/* ═══════════════════════════════════════════════════════
   INSTRUMENTS MODULE
   ═══════════════════════════════════════════════════════ */

.inst-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.inst-tab {
    font-size: 0.9rem;
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    font-family: var(--font);
    font-weight: 400;
    transition: color 0.15s;
}

.inst-tab:hover { color: var(--text); }

.inst-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 500;
}

.inst-tab.disabled {
    color: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
    font-style: italic;
}

.inst-tool-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inst-tool-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.inst-tool-card:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.inst-tool-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.inst-tool-body h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.inst-tool-body p {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.inst-tool-meta {
    display: block;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.inst-scores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.inst-score-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
}

.inst-score-name { color: var(--text-secondary); }

.inst-score-value {
    font-weight: 600;
    font-size: 0.82rem;
}

.inst-score-0 { color: var(--error); }
.inst-score-1 { color: var(--warn); }
.inst-score-2 { color: var(--text-secondary); }
.inst-score-3 { color: var(--success); }

/* ── Consulting depth info tooltip ───── */

.inst-info-trigger {
    position: relative;
    display: inline-block;
    margin-left: 4px;
}

.inst-info-tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: 22px;
    z-index: 200;
    width: 420px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text);
}

.inst-info-trigger:hover .inst-info-tooltip { display: block; }

.inst-info-dims {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inst-info-dims span {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.inst-info-dims b {
    color: var(--text);
    font-weight: 600;
    margin-right: 2px;
}

/* ── In-app explainer panel ────────── */

.inst-explainer {
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.inst-explainer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.inst-explainer p { margin-bottom: 8px; }
.inst-explainer p:last-of-type { margin-bottom: 4px; }

.inst-explainer-dims {
    margin-top: 10px;
}

.inst-explainer-dims summary {
    cursor: pointer;
    font-weight: 500;
    font-size: 0.84rem;
    color: var(--accent);
}

.inst-explainer-dims summary:hover { text-decoration: underline; }

.inst-explainer-dim-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
    padding-left: 4px;
}

.inst-explainer-dim-list span {
    font-size: 0.78rem;
    line-height: 1.4;
}

.inst-explainer-dim-list b {
    color: var(--text);
    font-weight: 600;
    margin-right: 2px;
}

/* ── Form helpers used by instruments (and reusable) ── */

.form-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 16px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 16px;
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}


/* ═══════════════════════════════════════════════════════
   FORMS + INPUTS
   ═══════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.87rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* fix2 §3 - stands in for the hidden output-path field in web mode. Same
   type scale and muted colour as .form-hint. */
.mf-output-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* fix3 §1b - study bar: first row of the content column, on every page.
   Replaces fix2's sidebar chip, which nobody saw. Literal hex: app.css has
   --warn/--warn-bg but no info-surface or surface-border tokens, so both
   states stay literal rather than half-substituted. */
.mf-study-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 40px;
    padding: 0 20px;
    margin: 0 0 12px 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    background: #E8F1FB;
    color: #163A5F;
    border: 1px solid #B9D3EE;
}

.mf-study-bar.is-empty {
    background: #FFF4E5;
    color: #8A4B00;
    border-color: #F5C98A;
}

.mf-study-bar__skips {
    font-weight: 400;
    font-size: 13px;
    opacity: 0.85;
}

.mf-study-bar__cta {
    margin-left: auto;
    font-weight: 500;
    font-size: 13px;
    opacity: 0.8;
}

.mf-study-bar:hover { filter: brightness(0.97); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    background: var(--bg-input);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: #fff;
}

.file-picker {
    display: flex;
    gap: 8px;
    align-items: center;
}

.file-picker input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.file-picker-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.file-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.file-picker-item button {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
}

.file-picker-item button:hover { color: var(--error); }


/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
    line-height: 1;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover { background: var(--bg-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}


/* ═══════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════ */

.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 0.9rem;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.page-breadcrumb a { color: var(--text-muted); }
.page-breadcrumb a:hover { color: var(--accent); }


/* ═══════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════
   PROGRESS DISPLAY
   ═══════════════════════════════════════════════════════ */

.progress-container {
    margin: 24px 0;
}

.progress-bar-wrapper {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.log-output {
    background: var(--bg-code);
    color: #e2e8f0;
    border-radius: var(--radius);
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 16px;
}

.log-output .log-line {
    opacity: 0.8;
    /* web-parity-fix B2 — long lines wrap by default; the panel's toggle
       switches to a horizontal scroll (log-nowrap). */
    white-space: pre-wrap;
    word-break: break-word;
}

.log-output.log-nowrap {
    overflow-x: auto;
}

.log-output.log-nowrap .log-line {
    white-space: pre;
}

.log-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.log-tools .log-wrap-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.log-output .log-line:last-child {
    opacity: 1;
    color: #fff;
}


/* ═══════════════════════════════════════════════════════
   STEP INDICATOR
   ═══════════════════════════════════════════════════════ */

.step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
}

.step-dot {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.step-dot.active { color: var(--accent); font-weight: 500; }
.step-dot.completed { color: var(--success); }

.step-dot-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.step-dot.active .step-dot-circle {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.step-dot.completed .step-dot-circle {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
}

.step-connector.completed { background: var(--success); }


/* ═══════════════════════════════════════════════════════
   OUTPUT FILES
   ═══════════════════════════════════════════════════════ */

.output-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.output-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.output-file:hover { background: var(--bg-hover); }

.output-file-icon {
    color: var(--accent);
    flex-shrink: 0;
}

.output-file-name {
    flex: 1;
    font-size: 0.87rem;
    font-weight: 500;
}

.output-file-size {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.output-file a {
    font-size: 0.82rem;
    font-weight: 500;
}


/* ═══════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.alert-info    { background: var(--bg-input); color: var(--text-secondary); }
.alert-warning { background: var(--warn-bg); color: var(--warn); }
.alert-error   { background: var(--error-bg); color: var(--error); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-guidance { background: #FBEDEB; color: var(--text); border-left: 3px solid #E83524; border-radius: 2px; }
.alert-info svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; margin-top: 1px; }


/* ═══════════════════════════════════════════════════════
   FRAMEWORK EDITOR (Quant)
   ═══════════════════════════════════════════════════════ */

.objective-card {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
}

.objective-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.objective-qids {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.qid-tag {
    display: inline-block;
    padding: 3px 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    font-weight: 500;
}


/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .engine-cards { grid-template-columns: 1fr; }
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; padding: 28px 24px; }
    .home-card-body { padding: 24px 20px; gap: 16px; }
    .inst-scores-grid { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════ */

.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.gap-3 { gap: 12px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-sm { font-size: 0.87rem; }
.text-xs { font-size: 0.78rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.font-mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
/* ═══════════════════════════════════════════════════════
   Navigator styles — INJECTED FROM navigator.js
   This bypasses any browser cache on app.css. Identical
   styles also live in app.css for production-build correctness.
   ═══════════════════════════════════════════════════════ */

.nav-workspace {
    display: flex;
    flex-direction: column;
    gap: 14px;
    /* No viewport-height lock — workspace sizes to its content,
       and the page scrolls when the panels exceed the viewport. */
}

.nav-doc-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
}
.nav-doc-strip > * { margin-right: 8px; margin-bottom: 4px; }
.nav-doc-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 14px;
    font-size: 0.78rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
    font-weight: 500;
}
.nav-doc-chip-l1 {
    border-color: rgba(232, 53, 36, 0.35);
    background: rgba(232, 53, 36, 0.06);
}
.nav-doc-chip-l2 {
    border-color: rgba(180, 120, 60, 0.35);
    background: rgba(180, 120, 60, 0.06);
}
.nav-running-pill {
    margin-left: 8px;
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 500;
}

.nav-cols {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nav-col-summary, .nav-col-chat {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.nav-col-summary { height: 620px; flex-shrink: 0; }
.nav-col-chat    { height: 560px; flex-shrink: 0; }

/* Drag handle between the workspace + chat columns. Sized to be
   discoverable without taking up obvious vertical space. The full
   handle is a 10px-tall hit zone; the visible accent bar is a 4px
   strip centered inside, with a hover state that brightens to the
   accent color so the analyst notices the affordance.

   The handler (Navigator._startChatResize) mutates style.height on
   both columns inline; persisted to localStorage on mouseup and
   restored via Navigator._applySavedChatHeights after every render. */
.nav-chat-resize-handle {
    height: 10px;
    margin: -2px 0;            /* tightens the gap so the handle
                                  doesn't add visual height between
                                  the columns when not hovered */
    cursor: row-resize;
    position: relative;
    flex-shrink: 0;
    user-select: none;
    z-index: 5;
}
.nav-chat-resize-handle::before {
    content: "";
    position: absolute;
    left: 25%;
    right: 25%;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    transition: background 120ms ease, height 120ms ease;
}
.nav-chat-resize-handle:hover::before,
.nav-chat-resize-handle:active::before {
    background: var(--accent);
    height: 5px;
}
/* Subtle "grip" cue: three small dots overlaid on the bar so the
   handle reads as a control, not decoration. Pure CSS — no extra
   markup. */
.nav-chat-resize-handle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36px;
    height: 4px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--text-muted) 1px, transparent 1.5px) 0 0 / 8px 8px repeat-x;
    opacity: 0.6;
    pointer-events: none;
}
.nav-chat-resize-handle:hover::after,
.nav-chat-resize-handle:active::after {
    opacity: 1;
}

.nav-section-header {
    display: flex;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-input);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}
.nav-section-header > * { margin-right: 8px; }
.nav-section-header [data-lucide] {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.nav-empty {
    padding: 28px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-style: italic;
}

/* ── Findings Summary document ────────────────────────── */
.nav-summary-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px 36px 40px 36px;
}

.nav-summary-doc {
    max-width: 720px;
    color: var(--text);
}

.nav-summary-section {
    display: grid;
    grid-template-columns: 40px 1fr;
    padding: 28px 0 32px 0;
    border-top: 1px solid var(--border);
}
.nav-summary-section:first-child {
    border-top: none;
    padding-top: 0;
}
.nav-summary-section > * + * { margin-left: 16px; }

.nav-summary-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(232, 53, 36, 0.12);
    color: var(--accent);
    font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 2px;
}

.nav-summary-section-title {
    margin: 0 0 16px 0;
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text);
    line-height: 1.3;
}

.nav-summary-section-body {
    font-size: 0.96rem;
    line-height: 1.75;
    color: var(--text);
}
.nav-summary-section-body p {
    margin: 0 0 14px 0;
}
.nav-summary-section-body p:last-child { margin-bottom: 0; }

/* "Drawn from:" — bold prefix, muted rest, smaller, separated */
.nav-source-line {
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
    letter-spacing: 0.01em;
}
.nav-source-line strong {
    color: var(--text-secondary);
    font-weight: 600;
    font-style: normal;
    margin-right: 4px;
}

.nav-summary-prose {
    font-size: 0.96rem;
    line-height: 1.75;
    color: var(--text);
}
.nav-summary-prose p { margin: 0 0 14px 0; }

/* ── Load-guide cards (Step 1) ───────────────────────── */
.nav-load-intro {
    margin: 8px 0 24px 0;
}
.nav-load-intro p {
    margin: 0 0 14px 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.nav-load-intro p:last-child { margin-bottom: 0; }
.nav-load-bar {
    padding: 14px 18px;
    background: rgba(232, 53, 36, 0.07);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    color: var(--text) !important;
}
.nav-load-bar strong { color: var(--text); }
.nav-load-bar code,
.nav-load-intro code {
    font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
    font-size: 0.86em;
    padding: 1px 5px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
}
.nav-load-guide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin: 22px 0 26px 0;
}
@media (max-width: 1100px) {
    .nav-load-guide { grid-template-columns: 1fr; }
}
.nav-load-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    overflow: hidden;
    margin-bottom: 8px;
}
.nav-load-card-header {
    display: flex;
    align-items: center;
    padding: 11px 16px;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text);
}
.nav-load-card-header [data-lucide] {
    width: 16px; height: 16px; color: var(--accent);
    margin-right: 8px;
}
.nav-load-card-body {
    padding: 16px 18px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.nav-load-primary {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 18px;
    background: rgba(232, 53, 36, 0.10) !important;
    border: 1.5px solid rgba(232, 53, 36, 0.45) !important;
    border-radius: 5px;
}
.nav-load-primary code {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
    font-size: 0.86rem;
    color: var(--text);
    font-weight: 500;
    background: transparent;
    padding: 0;
    border: none;
}
.nav-load-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    font-weight: 700;
    margin-left: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-load-supporting-label {
    font-size: 0.74rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 8px;
}
.nav-load-row {
    padding: 5px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.nav-load-row code {
    font-family: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
    font-size: 0.8rem;
    color: var(--text);
    background: var(--bg-input);
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid var(--border);
}

/* ── Chat column ─────────────────────────────────────── */
.nav-chat-history {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.nav-chat-history > * + * { margin-top: 14px; }

.nav-chat-turn {
    display: flex;
    flex-direction: column;
    max-width: 92%;
}
.nav-chat-user { align-self: flex-end; align-items: flex-end; }
.nav-chat-assistant { align-self: flex-start; }

.nav-chat-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 4px;
}

.nav-chat-bubble {
    padding: 11px 15px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    line-height: 1.6;
}
.nav-chat-bubble p { margin: 0 0 8px 0; }
.nav-chat-bubble p:last-child { margin-bottom: 0; }

.nav-chat-user .nav-chat-bubble {
    background: rgba(232, 53, 36, 0.12);
    color: var(--text);
    border-bottom-right-radius: 4px;
}
.nav-chat-assistant .nav-chat-bubble {
    background: var(--bg-input);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.nav-tool-trace {
    font-size: 0.74rem;
    color: var(--text-muted);
    padding-left: 4px;
    margin-bottom: 4px;
}
.nav-tool-chip {
    display: inline-block;
    padding: 1px 7px;
    margin-right: 4px;
    background: rgba(180, 120, 60, 0.1);
    color: #8a5829;
    border-radius: 3px;
    font-style: italic;
}

.nav-mode-toggle {
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-left: auto;
}
.nav-mode-btn {
    border: none;
    background: transparent;
    padding: 5px 13px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
}
.nav-mode-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.nav-mode-btn.active {
    background: var(--accent);
    color: #fff;
}

.nav-suggested-row {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-input);
    max-height: 90px;
    overflow-y: auto;
}
.nav-suggested-row > * { margin-right: 6px; margin-bottom: 6px; }
.nav-suggested-chip {
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 5px 11px;
    border-radius: 14px;
    font-size: 0.77rem;
    color: var(--text-secondary);
    cursor: pointer;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    font-family: inherit;
}
.nav-suggested-chip:hover {
    background: rgba(232, 53, 36, 0.08);
    color: var(--text);
    border-color: var(--accent);
}

.nav-chat-input-row {
    display: flex;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}
.nav-chat-input-row > * + * { margin-left: 10px; }
.nav-chat-input-row textarea {
    flex: 1;
    resize: vertical;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--bg-input);
    color: var(--text);
    min-height: 46px;
    max-height: 200px;
    line-height: 1.5;
}
.nav-chat-input-row textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.nav-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.nav-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.nav-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.nav-modal-header h3 { margin: 0; font-size: 1.05rem; }
.nav-modal-body { padding: 18px 20px; overflow-y: auto; }

@media (max-width: 1100px) {
    .nav-col-summary { height: 540px; }
    .nav-col-chat    { height: 480px; }
}

/* Branding: "MiNDai" — "ai" smaller and italic, flush at the baseline,
   wrapped in a no-break container so it never splits across lines. */
.brand-mark {
    white-space: nowrap;
}
.brand-ai {
    font-size: 0.62em;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
    opacity: 0.85;
}


/* ─── Construct mapping hover tooltips ────────────────────────────── */
.mf-hover-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    cursor: help;
    user-select: none;
    transition: color 0.15s;
    line-height: 1;
    vertical-align: middle;
}
.mf-hover-icon:hover, .mf-hover-icon:focus {
    color: var(--accent, #14766B);
    outline: none;
}
.mf-hover-tip {
    position: fixed;
    z-index: 9999;
    max-width: 360px;
    min-width: 280px;
    max-height: 80vh;
    overflow-y: auto;
    background: #FFFFFF;
    color: #1A1A1A;
    border: 1px solid var(--border, #E0E0E0);
    border-left: 3px solid var(--accent, #14766B);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 12px 14px 10px;
    font-size: 0.83rem;
    line-height: 1.4;
    display: none;
    pointer-events: auto;
}
.mf-tip-block {
    margin-bottom: 8px;
}
.mf-tip-block:last-child {
    margin-bottom: 0;
}
.mf-tip-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #14766B;
    margin-bottom: 3px;
}
.mf-tip-body {
    color: #333;
}


/* ══════════════════════════════════════════════════════════════════════
   W7 — the study picker and the Workspace panel.
   mindfrog-brand + mindfrog-rip-design: zones, not cards. White ground, 1px
   #C8C8C8 rules, no shadows, no gradients, radius ≤ 2px; red only where it
   means something — the brand rule, the current folder, the selected row,
   the one primary action. Headlines in ITC Avant Garde Gothic → Century
   Gothic → Futura, UPPERCASE; body Helvetica Neue 300, line-height ≥ 1.5.
   ══════════════════════════════════════════════════════════════════════ */
:root {
    --mf-red: #E83524;
    --mf-red-hover: #B82A1C;
    --mf-black: #000000;
    --mf-grey-1: #A7A7A7;
    --mf-grey-2: #C8C8C8;
    --mf-grey-3: #404040;
    --mf-off: #F5F5F5;
    --mf-head: 'ITC Avant Garde Gothic', 'Century Gothic', 'Futura', 'Trebuchet MS', sans-serif;
    --mf-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.mf-picker-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0, 0, 0, 0.55);
    display: flex; align-items: center; justify-content: center;
}

.mf-picker, .mf-ws {
    background: #fff; color: var(--mf-black);
    font-family: var(--mf-body); font-weight: 300; line-height: 1.5;
    border-top: 3px solid var(--mf-red);          /* the brand rule */
    border-radius: 0 0 2px 2px;
    display: flex; flex-direction: column;
}
.mf-picker { width: min(900px, 96vw); height: min(600px, 92vh); }
.mf-ws { width: min(620px, 96vw); max-height: 92vh; overflow: auto; padding-bottom: 20px; }
@media (max-width: 720px) {
    .mf-picker { width: 100vw; height: 100vh; border-radius: 0; }
    .mf-picker__tree { display: none; }
}

.mf-picker__head, .mf-ws__head {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px;
    padding: 18px 24px 12px; border-bottom: 1px solid var(--mf-grey-2);
}
.mf-picker__title, .mf-ws__title, .mf-ws__label {
    font-family: var(--mf-head); font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; font-size: 13px; color: var(--mf-black);
}
.mf-picker__study, .mf-ws__study { font-size: 14px; color: var(--mf-grey-3); }

.mf-picker__bar {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 24px; border-bottom: 1px solid var(--mf-grey-2);
}
.mf-picker__crumbs {
    flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
    font-size: 13px; color: var(--mf-grey-3);
}
.mf-picker__crumb {
    background: none; border: 0; padding: 0; font: inherit; color: var(--mf-grey-3); cursor: pointer;
}
.mf-picker__crumb:hover, .mf-picker__crumb.is-current { color: var(--mf-black); }
.mf-picker__crumb.is-current { font-weight: 400; cursor: default; }
.mf-picker__sep { color: var(--mf-grey-1); }
input.mf-picker__search {
    width: 260px; max-width: 40%; padding: 6px 10px;
    border: 1px solid var(--mf-grey-2); border-radius: 2px; background: #fff;
    font-family: var(--mf-body); font-weight: 300; font-size: 13px; color: var(--mf-black);
    box-shadow: none; transition: none;
}
input.mf-picker__search:focus { border-color: var(--mf-black); box-shadow: none; background: #fff; }

.mf-picker__body { flex: 1; display: flex; min-height: 0; }
.mf-picker__tree {
    width: 260px; flex: 0 0 260px; overflow: auto;
    border-right: 1px solid var(--mf-grey-2); padding: 8px 0;
}
.mf-picker__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mf-picker__count {
    padding: 8px 24px; font-size: 12px; color: var(--mf-grey-3);
    border-bottom: 1px solid var(--mf-grey-2);
}
/* W7-polish §1.1 — the tree on screen is the one we last saw; this says a
   fresh one is on its way. Only ever visible over an already-drawn tree. */
.mf-picker__chip {
    padding: 5px 24px; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--mf-grey-3); background: var(--mf-off);
    border-bottom: 1px solid var(--mf-grey-2);
}
.mf-picker__list { flex: 1; overflow: auto; }

.mf-picker__node {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 5px 16px; border: 0; border-left: 3px solid transparent;
    background: none; font-family: var(--mf-body); font-weight: 300; font-size: 13px;
    color: var(--mf-black); text-align: left; cursor: pointer; line-height: 1.5;
}
.mf-picker__node:hover { background: var(--mf-off); }
.mf-picker__node.is-current { border-left-color: var(--mf-red); color: var(--mf-red); font-weight: 400; }

.mf-picker__row {
    display: grid; grid-template-columns: minmax(0, 1fr) 64px 84px 110px; align-items: center; gap: 12px;
    padding: 7px 24px 7px 21px; border-left: 3px solid transparent;
    border-bottom: 1px solid var(--mf-off); font-size: 13px; cursor: pointer;
}
.mf-picker__row:hover { background: var(--mf-off); }
.mf-picker__row.is-selected { border-left-color: var(--mf-red); background: var(--mf-off); }
.mf-picker__row.is-selected .mf-picker__name { color: var(--mf-red); font-weight: 400; }
.mf-picker__row.is-highlight { outline: 1px solid var(--mf-black); outline-offset: -1px; }
.mf-picker__row.is-dim { color: var(--mf-grey-1); cursor: default; }
.mf-picker__row.is-dim:hover { background: none; }
.mf-picker__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-picker__type {
    font-family: var(--mf-head); font-size: 10px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--mf-grey-3);
}
.is-dim .mf-picker__type { color: var(--mf-grey-1); }
.mf-picker__meta { font-size: 12px; color: var(--mf-grey-3); text-align: right; white-space: nowrap; }
.mf-picker__badge {
    font-family: var(--mf-head); font-size: 10px; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--mf-red); margin-left: 8px; white-space: nowrap;
}
.mf-picker__empty { padding: 48px 24px; text-align: center; color: var(--mf-grey-3); font-size: 14px; }

.mf-picker__foot {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px; border-top: 1px solid var(--mf-grey-2);
}
.mf-picker__status {
    flex: 1; min-width: 0; font-size: 12px; color: var(--mf-grey-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mf-picker__btn, .mf-picker__add, .mf-ws__btn {
    font-family: var(--mf-head); font-weight: 700; font-size: 12px; letter-spacing: 0.08em;
    text-transform: uppercase; padding: 9px 18px; line-height: 1;
    border: 1px solid var(--mf-black); border-radius: 2px;
    background: #fff; color: var(--mf-black); cursor: pointer;
}
.mf-picker__btn:hover, .mf-picker__add:hover, .mf-ws__btn:hover { background: var(--mf-off); }
.mf-picker__btn--primary, .mf-ws__btn--primary { background: var(--mf-red); border-color: var(--mf-red); color: #fff; }
.mf-picker__btn--primary:hover, .mf-ws__btn--primary:hover { background: var(--mf-red-hover); border-color: var(--mf-red-hover); }
.mf-picker__btn:disabled, .mf-picker__add:disabled, .mf-ws__btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mf-picker__add { border-color: var(--mf-grey-2); }
.mf-ws__btn--danger { border-color: var(--mf-red); color: var(--mf-red); }
.mf-ws__btn--danger:hover { background: var(--mf-red); color: #fff; }

.mf-ws__section { padding: 16px 24px 0; }
.mf-ws__label { margin-bottom: 8px; }
.mf-ws__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mf-ws__line { font-size: 13px; color: var(--mf-grey-3); margin-top: 8px; }
.mf-ws__counts { font-size: 13px; }
.mf-ws__count { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--mf-off); }
.mf-ws__count b { font-weight: 400; white-space: nowrap; }
.mf-ws__sub { color: var(--mf-grey-3); font-size: 12px; }
.mf-ws__rule { border-top: 1px solid var(--mf-grey-2); margin: 20px 24px 0; }
