.a4u-workspace {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
    border: 1px solid var(--color-gray-200, rgba(0,0,0,.125));
    border-radius: var(--border-radius, 4px);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding-top: 10px;
    background: var(--color-gray-25);
}

.a4u-workspace__panels {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.a4u-tabbar {
    background: transparent;
    border-bottom: 1px solid var(--color-gray-200);
}

.a4u-tabbar__list {
    list-style: none;
    margin: 0;
    padding: 0 8px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

.a4u-tabbar__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    cursor: pointer;
    user-select: none;
    color: var(--color-gray-700);
    background: transparent;
    margin-right: 2px;
    margin-bottom: -1px;
    white-space: nowrap;
    font-size: 12px;
    max-width: 250px;
    min-width: 180px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.a4u-tabbar__item:not(.active):hover {
    border-color: var(--color-gray-400) var(--color-gray-400) transparent;
    color: var(--color-blurple-500);
}

.a4u-tabbar__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
}

.a4u-tabbar__icon svg,
.a4u-tabbar__icon .icon {
    width: 14px;
    height: 14px;
}

.a4u-tabbar__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.a4u-tabbar__item.active {
    background: var(--color-white);
    border-color: var(--color-gray-400) var(--color-gray-400) var(--color-white);
    color: var(--color-blurple-500);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.a4u-tabbar__close {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--color-gray-500);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    /* Reserve space but hide by default on inactive tabs */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
}

.a4u-tabbar__close svg,
.a4u-tabbar__close .icon {
    width: 14px;
    height: 14px;
}

.a4u-tabbar__close:hover {
    color: var(--color-red-700);
}

/* Show close button on hover or keyboard focus (inactive tabs) */
.a4u-tabbar__item:hover .a4u-tabbar__close,
.a4u-tabbar__item:focus-within .a4u-tabbar__close {
    visibility: visible;
    opacity: 1;
}

/* Always show close button on the active tab */
.a4u-tabbar__item.active .a4u-tabbar__close {
    visibility: visible;
    opacity: 1;
    color: var(--color-blurple-400, var(--color-blurple-500));
}

.a4u-tabpanel {
    flex: 1;
    min-height: 0;
    overflow: auto;
    transition: opacity 0.2s ease;
}

/* Tab hover preview: the hovered (inactive) panel fades in on top */
.a4u-tabpanel.tab-hover-preview {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    inset: 0;
    background: var(--color-white, #fff);
    z-index: 10;
    transition: opacity 0.25s ease;
}

.a4u-tabpanel.tab-hover-preview.tab-hover-preview--visible {
    opacity: 1;
}

/* Active panel fades out slightly during hover preview */
.a4u-tabpanel.tab-hover-active-dimmed {
    opacity: 0.4;
    transition: opacity 0.25s ease;
}

.a4u-tabpanel__frame {
    flex: 1;
    min-height: 0;
}

.a4u-tabfloat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.a4u-tabfloat__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-200);
}

.a4u-tabfloat__back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--color-gray-200);
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--color-gray-700);
    font-size: 12px;
}

.a4u-tabfloat__back:hover {
    color: var(--color-blurple-500);
    border-color: var(--color-blurple-500);
}

.a4u-tabfloat__title {
    font-weight: 500;
    color: var(--color-gray-800);
}

.a4u-tabfloat__body {
    flex: 1;
    min-height: 0;
    padding: 8px 12px;
    overflow: auto;
}
