#griffinforms-app-leftsidebar {
    width: clamp(240px, 18vw, 300px);
    box-shadow: rgba(0, 0, 0, 0.133) 1px 0px 0px 0px;
}

.gf-leftsidebar-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#griffinforms-app-fieldselection-field-types-tab-pane {
    max-height: calc(100vh - var(--gf-wrapper-top, 0px) - 170px);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

#griffinforms-app-fieldselection-field-types-tab-pane::-webkit-scrollbar {
    width: 4px;
}

#griffinforms-app-fieldselection-field-types-tab-pane::-webkit-scrollbar-track {
    background: transparent;
}

#griffinforms-app-fieldselection-field-types-tab-pane::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.18);
    border-radius: 2px;
}

#griffinforms-app-leftsidebar .nav-underline {
    position: relative;
}

.gf-app-pro-field-pill {
    background: linear-gradient(135deg, rgba(124,58,237,0.07) 0%, rgba(236,72,153,0.07) 100%);
    border: 1px solid rgba(124,58,237,0.15);
    cursor: default;
}

#griffinforms-app-leftsidebar .nav-underline::after {
    content: "";
    position: absolute;
    left: var(--gf-lefttab-underline-left, 0px);
    bottom: -1px;
    width: var(--gf-lefttab-underline-width, 0px);
    height: 1.5px;
    background: blueviolet;
    transition: left 0.2s ease, width 0.2s ease;
}

/* ========== Structure Panel ========== */
.gf-leftsidebar-formtree-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.gf-leftsidebar-formtree-content::-webkit-scrollbar {
    width: 4px;
}

.gf-leftsidebar-formtree-content::-webkit-scrollbar-track {
    background: transparent;
}

.gf-leftsidebar-formtree-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.18);
    border-radius: 2px;
}

/* ========== Structure Counts Bar ========== */
.gf-formtree-counts {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 8px;
}

.gf-structure-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 4px;
    border-radius: 999px;
    color: #3c434a;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.6;
}

.gf-structure-chip .material-symbols-rounded {
    font-size: 14px;
    color: #1e1e1e;
}

/* ========== Tree Reset ========== */
.gf-form-tree,
.gf-form-tree ul,
.gf-form-tree li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gf-form-tree {
    padding: 4px 0 8px;
}

/* ========== Tree Rows ========== */
.gf-form-tree-row {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 32px;
    padding: 0 8px 0 4px;
    margin: 0 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.08s;
}

.gf-form-tree-row:hover,
.gf-form-tree-row--highlighted,
.gf-form-tree-row--selected {
    background: #f0f0f0;
}

.gf-form-tree-row--highlighted > .gf-form-tree-label {
    color: blueviolet;
}

/* ========== Indentation ========== */
.gf-form-tree > ul {
    padding-left: 4px;
}

.gf-form-tree ul ul {
    padding-left: 16px;
}

/* ========== Chevron ========== */
.gf-tree-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 2px;
}

.gf-tree-chevron:not(.gf-tree-chevron-disabled):hover {
    background: rgba(0, 0, 0, 0.07);
}

.gf-tree-chevron-icon {
    display: block;
    opacity: 0.4;
    transition: transform 0.15s ease;
}

.gf-tree-chevron-icon.gf-tree-chevron-rotated {
    transform: rotate(-90deg);
}

/* ========== Labels ========== */
.gf-form-tree-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 400;
    color: #3c434a;
    line-height: 1.4;
}

li[data-gf-itemtype="formpage"] > .gf-form-tree-row > .gf-form-tree-label,
li[data-gf-itemtype="pagerow"] > .gf-form-tree-row > .gf-form-tree-label {
    font-weight: 500;
    color: #1e1e1e;
}

/* ========== Count Badges ========== */
.gf-form-tree-count-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 2px;
    background: #f0f0f0;
    color: #1e1e1e;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

/* ========== Field rows ========== */
.gf-form-tree-row--field {
    padding-left: 4px;
}

.gf-form-tree li > ul {
    margin-top: 2px;
}

.gf-form-tree ul > li + li {
    margin-top: 2px;
}

.gf-form-tree-field-indent {
    flex-shrink: 0;
    width: 24px;
}

.gf-form-tree-field-icon {
    flex-shrink: 0;
    width: 13px;
    height: 13px;
    margin-right: 4px;
}

.gf-form-tree-label-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ========== Scrollbar ========== */
#griffinforms-app-leftsidebar-formtree-content {
    min-height: 0;
}
