:root {
    --background: #f5f6f7;
    --surface: #ffffff;
    --surface-soft: #f9fafb;

    --text: #16181b;
    --text-soft: #6b7280;
    --text-faint: #9ca3af;

    --border: #e5e7eb;
    --border-strong: #d7dbe0;

    --accent: #1f2937;

    --radius: 10px;

    --assistant-width: 30%;
    --assistant-min: 340px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);
    color: var(--text);
}

button,
textarea {
    font: inherit;
}


/* APP */

.app-shell {
    min-height: 100vh;

    display: grid;

    grid-template-columns:
        minmax(0, 7fr)
        minmax(var(--assistant-min), 3fr);

    transition: grid-template-columns .18s ease;
}

.app-shell.assistant-collapsed {
    grid-template-columns: minmax(0, 1fr) 0;
}


/* WORKSPACE */

.workspace {
    min-width: 0;
}

.topbar {
    height: 68px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 32px;

    border-bottom: 1px solid var(--border);

    background: var(--surface);
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.brand-name {
    font-weight: 700;
    letter-spacing: .08em;
    font-size: 15px;
}

.brand-section {
    font-size: 13px;
    color: var(--text-soft);
}

.assistant-toggle {
    display: block;

    border: 1px solid var(--border);
    background: var(--surface);

    padding: 8px 12px;

    border-radius: 7px;

    color: var(--text-soft);

    cursor: pointer;
}

.workspace-content {
    max-width: 1280px;

    padding: 52px 42px;

    margin: 0 auto;
}


/* INTRO */

.welcome {
    max-width: 690px;
}

.eyebrow {
    margin: 0 0 12px;

    font-size: 11px;
    font-weight: 700;

    color: var(--text-soft);

    letter-spacing: .14em;
}

.welcome h1 {
    margin: 0;

    font-size: clamp(28px, 3vw, 42px);

    font-weight: 600;

    letter-spacing: -.035em;
}

.welcome > p:last-child {
    margin-top: 14px;

    line-height: 1.65;

    color: var(--text-soft);
}


/* CARDS */

.cards {
    margin-top: 42px;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 14px;
}

.card {
    min-height: 148px;

    display: flex;
    flex-direction: column;

    padding: 21px;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: var(--surface);
}

.card-label {
    color: var(--text-soft);

    font-size: 13px;
}

.card-value {
    margin-top: 16px;

    font-size: 30px;
    font-weight: 500;
}

.card-description {
    margin-top: auto;

    color: var(--text-faint);

    font-size: 12px;
}


/* WORK */

.work-section {
    margin-top: 42px;
}

.section-header {
    margin-bottom: 14px;

    display: flex;
    align-items: end;
    justify-content: space-between;
}

.section-kicker {
    display: block;

    margin-bottom: 6px;

    color: var(--text-soft);

    font-size: 11px;
    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: .1em;
}

.section-header h2 {
    margin: 0;

    font-size: 18px;
    font-weight: 600;
}

.empty-state {
    min-height: 160px;

    display: flex;
    align-items: center;

    gap: 18px;

    padding: 28px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);
}

.empty-icon {
    width: 36px;
    height: 36px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border: 1px solid var(--border-strong);

    border-radius: 50%;

    color: var(--text-faint);
}

.empty-state strong {
    font-size: 14px;
}

.empty-state p {
    margin: 6px 0 0;

    color: var(--text-soft);

    line-height: 1.5;

    font-size: 13px;
}


/* ASSISTANT */

.assistant-panel {
    min-width: var(--assistant-min);

    height: 100vh;

    position: sticky;
    top: 0;

    display: grid;

    grid-template-rows:
        auto
        minmax(0, 1fr)
        auto
        auto;

    background: var(--surface);

    border-left: 1px solid var(--border);

    overflow: hidden;
}

.app-shell.assistant-collapsed .assistant-panel {
    visibility: hidden;
}
.app-shell.assistant-collapsed .assistant-panel {
    min-width: 0;
    width: 0;
    border-left: 0;
}

.assistant-header {
    min-height: 68px;

    padding: 15px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}

.assistant-status {
    display: flex;
    align-items: center;

    gap: 8px;

    font-size: 13px;
    font-weight: 600;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #5f9d72;
}

.assistant-header p {
    margin: 4px 0 0;

    color: var(--text-faint);

    font-size: 11px;
}

.assistant-close {
    width: 32px;
    height: 32px;

    border: 0;

    background: transparent;

    color: var(--text-soft);

    font-size: 23px;

    cursor: pointer;
}

.assistant-messages {
    min-height: 0;

    padding: 24px 20px;

    overflow-y: auto;
}

.assistant-message {
    display: flex;

    gap: 12px;
}

.assistant-avatar {
    width: 28px;
    height: 28px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 7px;

    background: var(--accent);

    color: white;

    font-size: 12px;
    font-weight: 600;
}

.message-content {
    font-size: 13px;

    line-height: 1.6;
}

.message-content p {
    margin: 0 0 8px;
}

.assistant-context {
    padding: 11px 18px;

    display: flex;
    justify-content: space-between;

    border-top: 1px solid var(--border);

    background: var(--surface-soft);

    font-size: 11px;
}

.assistant-context span {
    color: var(--text-faint);
}

.assistant-context strong {
    font-weight: 500;
}

.assistant-form {
    padding: 14px;

    display: grid;

    grid-template-columns: minmax(0, 1fr) auto;

    gap: 8px;

    border-top: 1px solid var(--border);
}

.assistant-form textarea {
    width: 100%;

    min-height: 42px;
    max-height: 130px;

    resize: none;

    padding: 11px 12px;

    border: 1px solid var(--border);

    border-radius: 8px;

    outline: none;

    background: var(--surface-soft);

    color: var(--text);
}

.assistant-form textarea:focus {
    border-color: var(--border-strong);

    background: var(--surface);
}

.assistant-form button {
    width: 42px;
    height: 42px;

    align-self: end;

    border: 0;

    border-radius: 8px;

    background: var(--accent);

    color: white;

    cursor: pointer;

    font-size: 18px;
}


/* RESPONSIVE */

@media (max-width: 900px) {

    .app-shell {
        display: block;
    }

    .assistant-toggle {
        display: block;
    }

    .workspace-content {
        padding: 32px 20px;
    }

    .topbar {
        padding: 0 20px;
    }

    .brand-section {
        display: none;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .assistant-panel {
        position: fixed;

        z-index: 20;

        top: 0;
        right: 0;

        width: min(92vw, 420px);

        min-width: 0;

        box-shadow: -12px 0 40px rgba(0, 0, 0, .08);

        transform: translateX(0);

        transition: transform .18s ease;
    }

    .app-shell.assistant-collapsed .assistant-panel {
        visibility: visible;

        transform: translateX(105%);
    }

}
EOFmkdir -p public/js

cat > public/js/ofinova.js <<'EOF'
