﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #0078d4;
    --color-primary-dark: #005a9e;
    --accent-color: var(--color-primary);
    --color-success: #107c10;
    --color-warning: #ffb900;
    --color-error: #d13438;
    
    /* Light mode */
    --bg-primary: #ffffff;
    --bg-secondary: #f3f2f1;
    --bg-tertiary: #efefef;
    --text-primary: #323130;
    --text-secondary: #605e5c;
    --text-tertiary: #a19f9d;
    --border-color: #d2d0ce;
    --shadow: 0 1.6px 3.6px rgba(0, 0, 0, 0.11), 0 3.6px 7.2px rgba(0, 0, 0, 0.13);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-tertiary: #a0a0a0;
    --border-color: #404040;
    --shadow: 0 1.6px 3.6px rgba(0, 0, 0, 0.3), 0 3.6px 7.2px rgba(0, 0, 0, 0.4);
}

html,
body {
    height: 100%;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow: hidden;
}

/* App Layout */

.app-container {
    display: flex;
    height: 100vh;
}

/* Navigation Rail */

.nav-rail {
    width: 60px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.nav-rail-header {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.logo {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: contain;
}

.nav-rail-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.nav-rail-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.nav-item {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--color-primary);
    color: white;
}

.nav-item .icon {
    font-size: 20px;
    line-height: 1;
}

.nav-item .label {
    font-size: 8px;
    margin-top: 2px;
}

/* Main Content */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 32px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.header-title {
    flex: 1;
}

.app-header h1 {
    font-size: 15px;
    margin-bottom: 0;
}

.app-header p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}

/* View Sections */

.view-container {
    display: none;
    flex: 1;
    overflow: auto;
}

.view-container.active {
    display: flex;
    flex-direction: column;
}

/* Modal */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-primary);
    padding: 24px;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal h2 {
    margin-bottom: 12px;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Dashboard */

.dashboard-container {
    padding: 24px;
}

.stat-card {
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.btn-sm {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-sm:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.chart {
    min-height: 200px;
}

/* Scrollbar Styling */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-secondary);
}

.chart {
    min-height: 200px;
    flex: 1;
    overflow-y: auto;
    scrollbar-color: var(--border-color) transparent;
    scrollbar-width: thin;
}

/* Webkit scrollbar for .chart */

.chart::-webkit-scrollbar {
    width: 6px;
}

.chart::-webkit-scrollbar-track {
    background: transparent;
}

.chart::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.chart::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Hide injected debug panels from extensions */

[id*="debug"],
[class*="debug-panel"] {
    display: none !important;
}

/* ── Docs view layout ──────────────────────────────────── */

.docs-view-layout {
        display: flex;
        height: 100%;
        overflow: hidden;
    }

:root { --docs-nav-w: 220px; }

.docs-view-nav {
        width: var(--docs-nav-w);
        min-width: var(--docs-nav-w);
        max-width: var(--docs-nav-w);
        flex-basis: var(--docs-nav-w);
        flex-shrink: 0;
        flex-grow: 0;
        background: var(--bg-secondary);
        border-right: none;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

.docs-view-resize-handle {
        width: 5px;
        flex-shrink: 0;
        background: var(--border-color);
        cursor: ew-resize;
        transition: background 0.15s;
        position: relative;
        z-index: 10;
    }

.docs-view-resize-handle:hover { background: rgba(99,102,241,0.7); }

.docs-view-nav-header {
        padding: 14px 14px 10px;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border-color);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.docs-view-nav-list {
        list-style: none;
        margin: 0;
        padding: 6px 0;
        overflow-y: auto;
        flex: 1;
    }

.docs-nav-btn {
        display: block;
        width: 100%;
        background: transparent;
        border: none;
        text-align: left;
        padding: 8px 14px;
        font-size: 12px;
        color: var(--text-secondary);
        cursor: pointer;
        border-radius: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.docs-nav-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.docs-nav-btn.active { color: var(--color-primary, #0078d4); background: rgba(0,120,212,0.1); font-weight: 600; }

.docs-view-body {
        flex: 1;
        overflow-y: auto;
        padding: 28px 36px;
    }

.docs-view-loading {
        color: var(--text-secondary);
        font-size: 14px;
        padding: 40px 0;
    }

.docs-tab-content { display: none; }

.docs-tab-content.active { display: block; }

.docs-section-title {
        font-size: 20px;
        font-weight: 700;
        margin: 0 0 18px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border-color);
    }

.docs-heading { font-size: 15px; font-weight: 600; margin: 18px 0 8px; color: var(--text-primary); }

.docs-text { font-size: 13px; line-height: 1.7; margin: 0 0 10px; color: var(--text-secondary); }

.docs-list { font-size: 13px; line-height: 1.7; margin: 0 0 12px 18px; color: var(--text-secondary); }

.docs-list li { margin-bottom: 4px; }

.docs-table-wrap { overflow-x: auto; margin: 12px 0 18px; }

.docs-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }

.docs-table th { background: var(--bg-secondary); padding: 7px 12px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border-color); white-space: nowrap; }

.docs-table td { padding: 6px 12px; border-bottom: 1px solid var(--border-color); vertical-align: top; }

.docs-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

.docs-code { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 5px; padding: 12px 16px; font-size: 11px; line-height: 1.6; overflow-x: auto; margin: 10px 0 16px; white-space: pre; }

.docs-mermaid-wrap { margin: 16px 0 24px; min-height: 60px; background: rgba(0,0,0,0.15); border-radius: 6px; padding: 16px; overflow-x: auto; }

.docs-mermaid-wrap svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }

.docs-mermaid-error { color: var(--text-secondary); font-size: 11px; }

/* ── ASAF Ebook typography mode ──────────────────────────────── */

.ebook-mode .docs-view-body { background: var(--bg-primary); }

.ebook-mode .docs-tab-content { max-width: 760px; margin: 0 auto; padding-bottom: 80px; }

/* Chapter header — eyebrow label + large title + accent bar */

.docs-chapter-header { margin: 0 0 44px; padding: 28px 0 24px; border-bottom: 1px solid rgba(255,255,255,0.09); }

.docs-chapter-eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(129,140,248,0.9); margin-bottom: 10px; }

.ebook-mode .docs-chapter-title { font-size: 30px; font-weight: 800; letter-spacing: -0.022em; line-height: 1.18; color: var(--text-primary); margin: 0 0 18px; }

.docs-chapter-accent { display: block; width: 42px; height: 3px; background: linear-gradient(90deg, rgba(99,102,241,0.9) 0%, rgba(59,130,246,0.35) 100%); border-radius: 2px; }

/* Nav: indigo left-border active indicator + full text wrapping */

.ebook-mode .docs-nav-btn { border-left: 2px solid transparent; transition: background 0.12s, color 0.12s, border-color 0.12s; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.4; }

.ebook-mode .docs-nav-btn.active { color: rgba(165,180,252,0.95); background: rgba(99,102,241,0.13); border-left-color: rgba(99,102,241,0.7); font-weight: 600; }

.ebook-mode .docs-nav-btn:hover:not(.active) { background: rgba(255,255,255,0.04); }

/* H3 — section heading with left accent bar */

.ebook-mode .docs-markdown h3.docs-heading { font-size: 20px; font-weight: 700; margin: 50px 0 14px; color: var(--text-primary); padding: 2px 0 2px 14px; border-left: 3px solid rgba(99,102,241,0.65); line-height: 1.3; }

/* H4 — labelled sub-section eyebrow */

.ebook-mode .docs-markdown h4.docs-heading { font-size: 12px; font-weight: 700; margin: 32px 0 10px; color: rgba(165,180,252,0.85); text-transform: uppercase; letter-spacing: 0.09em; }

/* H5 / H6 */

.ebook-mode .docs-markdown h5.docs-heading { font-size: 12px; font-weight: 600; margin: 22px 0 8px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; opacity: 0.65; }

.ebook-mode .docs-markdown h6.docs-heading { font-size: 12px; font-weight: 600; margin: 14px 0 6px; color: var(--text-secondary); }

/* Body text */

.ebook-mode .docs-markdown .docs-text { font-size: 15px; line-height: 1.92; margin: 0 0 18px; color: var(--text-secondary); }

.ebook-mode .docs-markdown .docs-list { font-size: 15px; line-height: 1.82; margin: 0 0 18px 4px; color: var(--text-secondary); padding-left: 22px; }

.ebook-mode .docs-markdown .docs-list li { margin-bottom: 9px; padding-left: 4px; }

.ebook-mode .docs-markdown .docs-list li::marker { color: rgba(99,102,241,0.65); }

.ebook-mode .docs-markdown .docs-list-ordered li::marker { color: rgba(99,102,241,0.65); font-weight: 700; }

.ebook-mode .docs-markdown strong { color: var(--text-primary); font-weight: 700; }

.ebook-mode .docs-markdown em { color: rgba(199,210,254,0.78); font-style: italic; }

.ebook-mode .docs-markdown code { background: rgba(99,102,241,0.11); border: 1px solid rgba(99,102,241,0.22); border-radius: 3px; padding: 1px 6px; font-size: 13px; color: rgba(165,180,252,0.92); font-family: 'Consolas','Monaco',monospace; }

/* Horizontal rule */

.ebook-mode .docs-markdown .docs-rule { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 44px 0; }

/* Blockquote / principle callout */

.ebook-mode .docs-markdown blockquote.docs-blockquote { border-left: 4px solid rgba(129,140,248,0.7); margin: 26px 0; padding: 16px 22px; background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(99,102,241,0.04) 100%); border-radius: 0 8px 8px 0; font-style: italic; font-size: 15px; line-height: 1.78; color: rgba(199,210,254,0.88); }

/* Table — gradient header, clean rows, rounded container */

.ebook-mode .docs-markdown .docs-table-wrap { margin: 26px 0 34px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.09); box-shadow: 0 2px 12px rgba(0,0,0,0.25); }

.ebook-mode .docs-markdown .docs-table { font-size: 13.5px; width: 100%; border-collapse: collapse; }

.ebook-mode .docs-markdown .docs-table th { background: linear-gradient(135deg, rgba(99,102,241,0.24) 0%, rgba(59,130,246,0.14) 100%); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 11px 16px; color: rgba(199,210,254,0.92); font-weight: 700; border-bottom: 1px solid rgba(99,102,241,0.3); white-space: nowrap; }

.ebook-mode .docs-markdown .docs-table td { padding: 11px 16px; font-size: 13.5px; line-height: 1.58; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }

.ebook-mode .docs-markdown .docs-table tbody tr:hover td { background: rgba(255,255,255,0.025); transition: background 0.1s; }

.ebook-mode .docs-markdown .docs-table tbody tr:last-child td { border-bottom: none; }

/* Viz block — card style */

.ebook-mode .docs-asaf-viz { background: linear-gradient(145deg, rgba(15,23,42,0.88) 0%, rgba(30,41,59,0.52) 100%); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 20px 18px 14px; margin: 8px 0 34px; box-shadow: 0 4px 18px rgba(0,0,0,0.3); }

/* ── ASAF dimension visualization ────────────────────────────── */

.docs-asaf-viz { margin: 8px 0 20px; background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; padding: 14px 12px 10px; overflow: hidden; }

.docs-asaf-viz-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); margin: 0 0 6px; opacity: .65; }

.docs-asaf-viz-subtitle { font-size: 12px; color: var(--text-secondary); margin: 0 0 10px; opacity: .75; }

.docs-asaf-viz-body { display: flex; gap: 12px; align-items: flex-start; }

.docs-asaf-viz-svg-wrap { flex: 1; min-width: 0; }

.docs-asaf-viz-key { flex-shrink: 0; width: 170px; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }

.docs-asaf-viz-key-row { display: flex; align-items: center; gap: 5px; }

.docs-asaf-viz-key-badge { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 4px; color: #0f172a; letter-spacing: 0.04em; flex-shrink: 0; min-width: 30px; text-align: center; }

.docs-asaf-viz-key-name { font-size: 9px; color: var(--text-secondary); opacity: 0.7; line-height: 1.25; }

.docs-asaf-viz-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 2px; }

.docs-asaf-viz-tag { font-size: 11px; padding: 3px 9px; border-radius: 12px; background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.22); color: rgba(147,197,253,0.8); white-space: nowrap; }

.docs-asaf-viz-legend { display: flex; gap: 16px; margin: 8px 0 0; font-size: 10px; color: var(--text-secondary); opacity: .7; flex-wrap: wrap; }

.docs-asaf-viz-legend-item { display: flex; align-items: center; gap: 5px; }

.docs-asaf-viz-legend-line { width: 22px; height: 2px; display: inline-block; border-radius: 1px; }

/* ── Worksheet Wizard ──────────────────────────────────────── */

.ws-wizard { margin: 0; }

.ebook-mode .ws-wizard { background: var(--ws-card-bg); border-radius: 14px; padding: 28px 28px 24px; border: 1px solid var(--ws-border); margin: 4px 0 40px; }

/* Progress bar */

.ws-progress { display: flex; align-items: flex-start; gap: 0; margin: 0 0 26px; padding: 14px 18px; background: var(--ws-progress-bg); border-radius: 10px; border: 1px solid var(--ws-progress-border); flex-wrap: nowrap; overflow-x: auto; }

.ws-progress-step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 62px; cursor: default; }

.ws-progress-step-done { cursor: pointer; opacity: 0.7; }

.ws-progress-step-done:hover { opacity: 1; }

.ws-progress-dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ws-input-border); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--text-secondary); background: var(--ws-surface); flex-shrink: 0; }

.ws-progress-step-active .ws-progress-dot { background: rgba(99,102,241,0.85); border-color: rgba(129,140,248,0.9); color: #fff; }

.ws-progress-step-done .ws-progress-dot { background: rgba(52,211,153,0.2); border-color: rgba(52,211,153,0.55); color: rgba(52,211,153,0.9); }

.ws-progress-label { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); opacity: .6; white-space: nowrap; }

.ws-progress-step-active .ws-progress-label { color: rgba(165,180,252,0.9); opacity: 1; }

.ws-progress-line { flex: 1; height: 1px; background: var(--ws-slider-track); align-self: flex-start; margin-top: 12px; min-width: 10px; }

.ws-progress-line-done { background: rgba(52,211,153,0.35); }

/* Panel */

.ws-panel { }

.ws-step-body { }

.ws-step-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }

.ws-step-desc { font-size: 13px; color: var(--text-secondary); margin: 0 0 22px; line-height: 1.6; }

/* Form grid */

.ws-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 0 0 24px; }

.ws-field { display: flex; flex-direction: column; gap: 5px; }

.ws-field-wide { grid-column: 1 / -1; }

.ws-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-secondary); opacity: .85; }

.ws-req { color: rgba(251,113,133,0.9); }

.ws-input { background: var(--ws-input-bg); border: 1px solid var(--ws-input-border); border-radius: 6px; padding: 8px 12px; font-size: 13px; color: var(--text-primary); outline: none; font-family: inherit; transition: border-color .15s, background .15s; width: 100%; box-sizing: border-box; }

.ws-input::placeholder,
.ws-textarea::placeholder { color: var(--ws-placeholder); }

.ws-input:focus { border-color: rgba(99,102,241,0.65); background: rgba(99,102,241,0.06); }

.ws-input-sm { font-size: 12px; padding: 5px 10px; }

.ws-textarea { background: var(--ws-input-bg); border: 1px solid var(--ws-input-border); border-radius: 6px; padding: 8px 12px; font-size: 13px; color: var(--text-primary); outline: none; font-family: inherit; resize: vertical; transition: border-color .15s, background .15s; width: 100%; box-sizing: border-box; }

.ws-textarea:focus { border-color: rgba(99,102,241,0.65); background: rgba(99,102,241,0.06); }

.ws-textarea-sm { font-size: 12px; }

.ws-select { background: var(--ws-select-bg); border: 1px solid var(--ws-input-border); border-radius: 6px; padding: 8px 12px; font-size: 13px; color: var(--text-primary); outline: none; font-family: inherit; cursor: pointer; width: 100%; box-sizing: border-box; }

body.dark-mode .ws-select { color-scheme: dark; }

.ws-select option { background: var(--ws-select-bg); color: var(--text-primary); }

.ws-select:focus { border-color: rgba(99,102,241,0.65); }

.ws-select-sm { font-size: 11px; padding: 4px 8px; margin-top: 5px; color: var(--text-secondary); }

/* Buttons */

.ws-btn { padding: 9px 18px; border-radius: 7px; border: none; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: opacity .15s, background .15s; white-space: nowrap; }

.ws-btn-primary { background: linear-gradient(135deg, rgba(99,102,241,0.9) 0%, rgba(59,130,246,0.85) 100%); color: #fff; }

.ws-btn-primary:hover { opacity: .88; }

.ws-btn-secondary { background: var(--ws-surface); border: 1px solid var(--ws-border); color: var(--text-primary); }

.ws-btn-secondary:hover { background: var(--ws-surface-raised); }

.ws-btn-save { background: linear-gradient(135deg, rgba(52,211,153,0.9) 0%, rgba(16,185,129,0.85) 100%); color: #0f172a; font-weight: 700; }

.ws-btn-error { background: rgba(239,68,68,0.45) !important; color: #fff !important; }

.ws-btn-success { background: linear-gradient(135deg, rgba(52,211,153,0.9) 0%, rgba(16,185,129,0.85) 100%) !important; color: #0f172a !important; }

.ws-btn:disabled { opacity: .6; cursor: default; }

.ws-export-link { display: inline-flex; align-items: center; text-decoration: none; }

.ws-nav-row { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--ws-border-subtle); }

.ws-nav-spacer { flex: 1; }

/* Score slider */

.ws-slider-wrap { margin: 0 0 20px; }

.ws-slider-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-secondary); opacity: .85; margin-bottom: 10px; }

.ws-stage-row { display: flex; gap: 4px; margin-bottom: 8px; }

.ws-stage-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 2px; border-radius: 5px; border: 1px solid var(--ws-border-subtle); transition: all .15s; }

.ws-stage-num { font-size: 13px; font-weight: 800; color: var(--text-secondary); }

.ws-stage-lbl { font-size: 7.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); opacity: .55; }

.ws-stage-cell-active .ws-stage-num { font-size: 15px; }

.ws-stage-cell-active .ws-stage-lbl { opacity: 1; }

.ws-slider { -webkit-appearance: none; width: 100%; height: 5px; background: var(--ws-slider-track); border-radius: 3px; outline: none; margin: 4px 0 6px; cursor: pointer; }

.ws-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: rgba(99,102,241,0.9); cursor: pointer; border: 2px solid rgba(255,255,255,0.75); }

.ws-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: rgba(99,102,241,0.9); cursor: pointer; border: 2px solid rgba(255,255,255,0.75); box-sizing: border-box; }

.ws-stage-desc { font-size: 12px; font-style: italic; min-height: 18px; margin-top: 2px; }

/* Dimension navigator */

.ws-dim-nav { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }

.ws-dim-dot { padding: 4px 9px; border-radius: 5px; border: 1.5px solid var(--ws-border); background: var(--ws-surface); font-size: 10px; font-weight: 700; color: var(--text-secondary); cursor: pointer; transition: all .15s; letter-spacing: .05em; }

.ws-dim-dot:hover { background: var(--ws-surface-raised); }

.ws-dim-dot-active { border-color: var(--plane-color, rgba(99,102,241,0.7)); background: rgba(99,102,241,0.15); color: var(--text-primary); }

.ws-dim-dot-done::after { content: '\2713'; font-size: 8px; margin-left: 3px; opacity: .7; }

/* Dimension card */

.ws-dim-card { border-radius: 10px; border: 1px solid var(--ws-border); overflow: hidden; }

.ws-dim-header { padding: 14px 16px 12px; border-bottom: 1px solid var(--ws-border-subtle); }

.ws-dim-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

.ws-plane-badge { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.ws-dim-progress { font-size: 11px; color: var(--text-secondary); opacity: .55; }

.ws-dim-title { font-size: 15px; font-weight: 700; margin: 0 0 6px; color: var(--text-primary); }

.ws-dim-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.55; margin: 0; opacity: .85; }

.ws-dim-body { padding: 16px; display: flex; flex-direction: column; gap: 0; }

/* Summary */

.ws-stat-chips { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 18px; }

.ws-stat-chip { background: var(--ws-surface); border: 1px solid var(--ws-border-subtle); border-radius: 8px; padding: 12px 14px; }

.ws-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); opacity: .7; margin-bottom: 5px; }

.ws-stat-value { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 4px; }

.ws-stat-sub { font-size: 11px; color: var(--text-secondary); opacity: .65; }

.ws-chart-wrap { background: var(--ws-progress-bg); border-radius: 8px; padding: 14px; margin-bottom: 18px; border: 1px solid var(--ws-border-subtle); }

.ws-interp { background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.22); border-radius: 8px; padding: 14px 16px; margin-bottom: 4px; }

.ws-interp-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: rgba(165,180,252,0.8); margin: 0 0 10px; }

.ws-interp-item { font-size: 13px; color: var(--text-secondary); margin: 6px 0; line-height: 1.5; }

.ws-radio-row { display: flex; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }

.ws-radio-label { display: flex; align-items: center; gap: 5px; cursor: pointer; }

.ws-radio { accent-color: rgba(99,102,241,0.9); cursor: pointer; }

.ws-radio-opt { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }

.ws-radio-yes { color: rgba(52,211,153,0.9); }

.ws-radio-partly { color: rgba(251,191,36,0.9); }

.ws-radio-no { color: rgba(251,113,133,0.9); }

.ws-buyer-cat { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(99,102,241,0.85); margin: 0 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--ws-border-subtle); }

/* Save */

.ws-save-preview { background: var(--ws-surface); border: 1px solid var(--ws-border-subtle); border-radius: 8px; padding: 14px 16px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 5px; }

.ws-save-line { font-size: 13px; color: var(--text-secondary); }

.ws-save-lk { font-weight: 600; color: var(--text-primary); opacity: .75; }

.ws-save-lv { color: var(--text-secondary); }

.ws-save-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }

/* ── Assessment type toggle ───────────────────────────────── */

.ws-type-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }

.ws-type-card { padding: 12px 14px; border-radius: 8px; border: 1.5px solid var(--ws-input-border); background: var(--ws-surface); cursor: pointer; transition: all .15s; }

.ws-type-card:hover { background: var(--ws-surface-raised); }

.ws-type-card-active { border-color: rgba(99,102,241,0.7) !important; background: rgba(99,102,241,0.12) !important; }

.ws-type-card-label { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }

.ws-type-card-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }

/* ── Sub-dimension sliders ────────────────────────────────── */

.ws-sub-section { margin-bottom: 20px; }

.ws-sub-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); opacity: .7; margin-bottom: 10px; }

.ws-sub-slider-wrap { margin-bottom: 10px; padding: 10px 12px; background: var(--ws-surface); border-radius: 6px; border: 1px solid var(--ws-border-subtle); }

.ws-sub-slider-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }

.ws-sub-id { font-size: 10px; font-weight: 700; color: rgba(99,102,241,0.85); letter-spacing: .05em; flex-shrink: 0; }

.ws-sub-name { font-size: 12px; font-weight: 600; color: var(--text-primary); flex: 1; }

.ws-sub-score { font-size: 11px; font-weight: 700; margin-left: auto; flex-shrink: 0; }

.ws-sub-desc { font-size: 11px; color: var(--text-secondary); line-height: 1.45; margin-bottom: 6px; opacity: .75; }

.ws-slider-sub { height: 4px !important; }

.ws-slider-sub::-webkit-slider-thumb { width: 14px !important; height: 14px !important; }

.ws-slider-sub::-moz-range-thumb { width: 14px !important; height: 14px !important; }

/* ── Dimension score chip (computed avg) ─────────────────── */

.ws-dim-score-chip { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--ws-progress-bg); border-radius: 7px; margin-top: 12px; border: 1px solid var(--ws-border-subtle); }

.ws-dim-score-eyebrow { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-secondary); opacity: .65; flex-shrink: 0; }

.ws-dim-score-val { font-size: 22px; font-weight: 800; line-height: 1; }

.ws-dim-score-lbl { font-size: 12px; font-weight: 600; }

/* ── Vendor coverage grid ─────────────────────────────────── */

.ws-cov-section { margin-bottom: 24px; }

.ws-cov-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; background: var(--ws-surface); border-radius: 7px; border: 1px solid var(--ws-border-subtle); margin-bottom: 6px; flex-wrap: wrap; }

.ws-cov-dim { display: flex; align-items: center; gap: 8px; min-width: 200px; }

.ws-cov-id { font-size: 10px; font-weight: 700; letter-spacing: .05em; border: 1px solid; border-radius: 4px; padding: 2px 6px; flex-shrink: 0; }

.ws-cov-name { font-size: 12px; color: var(--text-secondary); }

.ws-cov-right { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 200px; }

.ws-input-sm { padding: 5px 9px; font-size: 12px; }

/* ── Ebook export button in nav ─────────────────────────────── */

.docs-nav-export-sep { height: 1px; background: rgba(255,255,255,0.07); margin: 14px 6px; }

.docs-nav-export-btn {
        display: block; padding: 8px 12px; border-radius: 7px; margin: 4px 0;
        background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.28);
        color: rgba(165,180,252,0.9); font-size: 12px; font-weight: 600;
        text-decoration: none; text-align: center; cursor: pointer; transition: all .15s;
    }

.docs-nav-export-btn:hover { background: rgba(99,102,241,0.2); border-color: rgba(99,102,241,0.5); color: #a5b4fc; }

/* ── Documentation View ──────────────────────────────────── */

/* Nav rail submenu (Docs -> topics) — fixed so the rail's overflow doesn't clip it */

.nav-item-group { position: relative; }

.nav-submenu {
        position: fixed;
        min-width: 180px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        box-shadow: 4px 4px 18px rgba(0,0,0,0.35);
        padding: 6px;
        display: flex; flex-direction: column; gap: 2px;
        z-index: 1100;
    }

.nav-submenu[hidden] { display: none; }

.nav-subitem {
        background: transparent; border: none;
        color: var(--text-secondary);
        text-align: left; padding: 7px 12px;
        font-size: 13px; cursor: pointer;
        border-radius: 4px;
        white-space: nowrap;
    }

.nav-subitem:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.nav-subitem.active { color: var(--color-primary, #0078d4); background: rgba(0,120,212,0.13); }

/* ── Dashboard tiles ───────────────────────────────────────────── */

.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }

.dash-tile { background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.dash-tile-head { display: flex; justify-content: space-between; align-items: center; }

.dash-tile-head h3 { font-size: 16px; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }

.dash-open,
.dash-link { background: none; border: none; color: var(--color-primary); cursor: pointer; font-size: 13px; padding: 0; text-align: left; }

.dash-open:hover,
.dash-link:hover { text-decoration: underline; }

.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }

.dash-stat { background: var(--bg-secondary); border-radius: 6px; padding: 10px 12px; }

.dash-stat-value { font-size: 20px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }

.dash-stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.dash-subhead { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); font-weight: 600; }

.dash-list { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-primary); }

.dash-list li { display: flex; gap: 8px; align-items: baseline; min-width: 0; }

.dash-list-date { color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }

.dash-list-meta { margin-left: auto; color: var(--text-secondary); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-empty { font-size: 13px; color: var(--text-tertiary); }

@media (max-width: 600px) {
    .dash-grid { grid-template-columns: 1fr; }
}
