/* ==========================================================================
   COLOSIAN MARKETS — TRADE INSIGHTS
   Analyst Notes Workspace
   ========================================================================== */


/*
 * Analyst Notes is intentionally document-oriented rather than using the
 * fixed-height terminal behaviour of the other Trade Insight workspaces.
 *
 * The page can grow naturally while the textarea provides a large dedicated
 * writing surface with its own vertical scrolling.
 */

.alpha-insight-page .trade-insights-detail__workspace-shell:has(.trade-insights-notes-workspace) {
    height: auto;
    min-height: 0;
    max-height: none;

    overflow: visible;
}


/* ==========================================================================
   Notes workspace
   ========================================================================== */

.alpha-insight-page .trade-insights-notes-workspace {
    width: 100%;
    height: auto;

    min-width: 0;
    min-height: 0;
    max-height: none;

    display: flex;
    flex-direction: column;

    overflow: visible;

    background: var(--ti-terminal);
}


/* ==========================================================================
   Compact toolbar
   ========================================================================== */

.alpha-insight-page .trade-insights-notes-workspace__toolbar {
    flex: 0 0 auto;

    min-width: 0;
    min-height: 52px;

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

    padding: 8px 16px;

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

    background:
        linear-gradient(90deg,
            rgba(139, 137, 190, 0.025),
            transparent 35%);
}


.alpha-insight-page .trade-insights-notes-workspace__toolbar-title {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 14px;
}


.alpha-insight-page .trade-insights-notes-workspace__toolbar-title .trade-insights-section-label {
    margin: 0;

    white-space: nowrap;
}


.alpha-insight-page .trade-insights-notes-workspace__count {
    color: var(--color-text-muted);

    font-size: 0.55rem;
    font-weight: 550;

    font-variant-numeric: tabular-nums;

    white-space: nowrap;
}


/* ==========================================================================
   Actions
   ========================================================================== */

.alpha-insight-page .trade-insights-notes-workspace__actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 14px;
}


.alpha-insight-page .trade-insights-notes-workspace__actions .tools-status {
    margin: 0;

    font-size: 0.54rem;

    white-space: nowrap;
}


.alpha-insight-page .trade-insights-notes-workspace__actions .button {
    min-width: 96px;
    min-height: 30px;

    padding: 5px 12px;

    border-radius: 5px;

    font-size: 0.56rem;
}


/* ==========================================================================
   Editor
   ========================================================================== */

.alpha-insight-page .trade-insights-notes-workspace__editor {
    width: 100%;

    min-width: 0;
    min-height: 0;

    padding: 14px 22px 22px;

    overflow: visible;

    box-sizing: border-box;
}


/* ==========================================================================
   Textarea
   ========================================================================== */

.alpha-insight-page .trade-insights-notes-workspace__textarea {
    display: block;

    width: 100%;

    height: 58vh;
    min-height: 500px;
    max-height: none;

    box-sizing: border-box;

    margin: 0;

    padding:
        20px 24px 140px;

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

    border-radius: 8px;

    outline: none;

    resize: vertical;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: auto;

    background:
        rgba(0, 0, 0, 0.12);

    color: var(--color-text);

    font: inherit;
    font-size: 0.72rem;
    line-height: 1.75;

    white-space: pre-wrap;

    scrollbar-width: thin;

    -webkit-overflow-scrolling: touch;
}


.alpha-insight-page .trade-insights-notes-workspace__textarea:focus {
    border-color:
        rgba(155, 151, 213, 0.42);

    background:
        rgba(0, 0, 0, 0.16);
}


.alpha-insight-page .trade-insights-notes-workspace__textarea::-webkit-scrollbar {
    width: 8px;
}


.alpha-insight-page .trade-insights-notes-workspace__textarea::-webkit-scrollbar-track {
    background: transparent;
}


.alpha-insight-page .trade-insights-notes-workspace__textarea::-webkit-scrollbar-thumb {
    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.14);
}


/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 900px) {

    .alpha-insight-page .trade-insights-notes-workspace__textarea {
        height: 65vh;
        min-height: 480px;
    }
}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 650px) {

    .alpha-insight-page .trade-insights-notes-workspace__toolbar {
        gap: 10px;

        padding: 7px 10px;
    }


    .alpha-insight-page .trade-insights-notes-workspace__toolbar-title {
        gap: 8px;
    }


    .alpha-insight-page .trade-insights-notes-workspace__editor {
        padding: 8px;
    }


    .alpha-insight-page .trade-insights-notes-workspace__textarea {
        height: 68vh;
        min-height: 440px;

        padding:
            16px 16px 100px;
    }
}