    Screen {
        background: $surface;
    }

    TextArea {
        background: $surface-darken-1;
        & > .text-area--cursor-line {
            background: transparent;
        }
        &:focus > .text-area--cursor-line {
            background: $surface-lighten-1;
        }
    }

    Input {
        background: $surface-darken-1;
    }

    Input:focus,
    TextArea:focus {
        background: $surface;
    }

    DataTable.flash-cell:focus > .datatable--cursor,
    DataTable.flash-row:focus > .datatable--cursor,
    DataTable.flash-all:focus > .datatable--cursor {
        background: $success 30%;
    }

    DataTable.flash-all {
        border: solid $success 30%;
    }

    .flash {
        background: $success 30%;
    }

    Screen.results-fullscreen #sidebar {
        display: none;
    }

    Screen.results-fullscreen #query-area {
        display: none;
    }

    Screen.results-fullscreen #results-area {
        height: 1fr;
    }

    Screen.query-fullscreen #sidebar {
        display: none;
    }

    Screen.query-fullscreen #results-area {
        display: none;
    }

    Screen.query-fullscreen #query-area {
        height: 1fr;
        border-bottom: none;
    }

    Screen.explorer-fullscreen #main-panel {
        display: none;
    }

    Screen.explorer-fullscreen #sidebar {
        width: 1fr;
    }

    Screen.explorer-hidden #sidebar {
        display: none;
    }

    #main-container {
        width: 100%;
        height: 100%;
    }

    #content {
        height: 1fr;
    }

    #sidebar {
        width: 35;
        border: round $border;
        padding: 1;
        margin: 0;
    }

    #object-tree {
        height: 1fr;
    }

    #main-panel {
        width: 1fr;
    }

    #query-area {
        height: 50%;
        border: round $border;
        padding: 1;
        margin: 0;
    }

    #query-input {
        height: 1fr;
        border: none;
        background: $surface;
    }

    #results-area {
        height: 50%;
        padding: 1;
        border: round $border;
        margin: 0;
    }

    #sidebar.active-pane,
    #query-area.active-pane,
    #results-area.active-pane {
        border: round $primary;
        border-title-color: $primary;
    }

    /* Vim mode cursor styling */
    #query-area.vim-normal TextArea > .text-area--cursor {
        /* Block cursor for NORMAL mode - warm beige */
        background: $mode-normal-color;
        color: $surface;
    }

    #query-area.vim-insert TextArea > .text-area--cursor {
        /* Cursor for INSERT mode - soft green (fallback when bar cursor is unavailable) */
        background: $mode-normal-color;
        color: $surface;
    }

    #query-area.vim-visual TextArea > .text-area--cursor,
    #query-area.vim-visual-line TextArea > .text-area--cursor {
        /* Block cursor for VISUAL modes */
        background: $mode-normal-color;
        color: $surface;
    }


    #results-area DataTable {
        height: 1fr;
    }

    /* Hide results table when value view is visible */
    #results-area.value-view-active DataTable {
        display: none;
    }

    #results-area.value-view-active #results-filter {
        display: none;
    }

    /* Hide single results table when showing stacked multi-statement results */
    /* Table IDs are results-table-1, results-table-2, etc. */
    #results-area.stacked-mode > SqlitDataTable {
        display: none;
    }

    #results-area.stacked-mode > Lazy {
        display: none;
    }

    #results-area.stacked-mode #results-filter {
        display: none;
    }

    #results-area.stacked-mode.results-filter-active #results-filter {
        display: block;
    }

    #results-area.stacked-mode #stacked-results {
        display: block;
    }

    /* FastDataTable header styling */
    DataTable > .datatable--header {
        background: $surface-lighten-1;
        color: $primary;
        text-style: bold;
    }

    DataTable:focus > .datatable--header {
        background: $primary 20%;
        color: $text;
    }

    .theme-ansi DataTable > .datatable--header {
        background: ansi_black;
        color: $primary;
        text-style: bold;
    }

    .theme-ansi DataTable > .datatable--fixed {
        background: ansi_black;
        color: $primary;
        text-style: bold;
    }

    .theme-ansi DataTable:focus > .datatable--header {
        background: ansi_black;
        color: $primary;
        text-style: bold;
    }

    .theme-ansi DataTable:dark > .datatable--even-row {
        background: ansi_bright_black 15%;
    }

    .theme-ansi DataTable:dark > .datatable--odd-row {
        background: transparent;
    }

    .theme-ansi DataTable > .datatable--cursor {
        background: ansi_bright_blue;
        color: ansi_black;
    }

    .theme-ansi DataTable > .datatable--selectrange {
        background: ansi_blue 30%;
        color: $text;
    }

    .theme-ansi DataTable > .datatable--fixed-cursor {
        background: ansi_blue 40%;
        color: $text;
    }

    .theme-ansi DataTable > .datatable--header-cursor {
        background: ansi_blue 40%;
        color: $text;
    }

    /* FastDataTable already has zebra stripes with $primary 10% */

    #status-bar {
        height: 1;
        background: $surface-darken-1;
        padding: 0 1;
    }

    #idle-scheduler-bar {
        height: 1;
        background: $primary-darken-3;
        padding: 0 1;
        display: none;
    }

    #idle-scheduler-bar.visible {
        display: block;
    }

    #sidebar,
    #query-area,
    #results-area {
        border-title-align: left;
        border-title-color: $border;
        border-title-background: $surface;
        border-title-style: bold;
    }

    #autocomplete-dropdown {
        layer: autocomplete;
        position: absolute;
        display: none;
    }

    #autocomplete-dropdown.visible {
        display: block;
    }
