.tab {
    padding: 2px 22px;
    white-space: nowrap;
    border-right: 1px solid #e3e3e3;
    color: #555;
    cursor: pointer;
    user-select: none;
    background: #f8f8f8;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tab:hover { background: #eaeaea; }

.tab.selected {
    font-weight: 600;
    background: #ffffff;
    color: #222;
    border-bottom: 2px solid #7bc240;
}

.tab-marker {
    position: absolute;
    top: -3px;
    bottom: 0;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    cursor: pointer;

    /* visual */
    background: #f8f8f8;
    color: #7bc240;
    font-size: 18px;
    font-weight: bold;

    border-radius: 0;       /* square */
    box-shadow: none;       /* remove floating look */
}

/* flush to edges */
.tab-marker.left  { left: 0; }
.tab-marker.right { right: 0; }


/* special first tab: add new */
.tab-new {
  white-space: nowrap;
  align-items: center;
  padding: 3px 22px;
  font-weight: 600;
  color: #7bc240;
  background: #eef7e8;
  border-right: 1px dashed #7bc240;
  cursor: pointer;
  height:28px;
}
.tab-new:hover {
  background: #e3f2d9;
}
.tab-new.selected {
  background: #eef7e8;
  border-bottom: none;
}


.content-area {
    padding: 20px;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tools { padding: 12px 20px; background: #fff; }
.tools button { margin-right: 8px; }



.tab-wrapper {
    display: flex;
    align-items: stretch;
    position: relative;
    background: #f8f8f8;
    border-bottom: 1px solid #ccc;
    overflow: hidden;
}

/* fixed (left) */
.tab-fixed {
    display: flex;
    flex: 0 0 auto;
    border-right: 1px solid #ccc;
    z-index: 5;
}

/* scrollable middle */
.tab-scroll-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.tab-container {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    height: 100%;
}

.tab-dropdown {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-left: 1px solid #ccc;
    background: #f0f0f0;
    user-select: none;
}
.tab-dropdown:hover {
    background: #e0e0e0;
}

.tab-dropdown-menu {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 1000;
    width: 240px;

    display: flex;
    flex-direction: column;

    max-height: 320px;   /* total height limit */
    overflow: hidden;    /* IMPORTANT: prevents spilling */
}

.tab-dropdown-search {
    padding: 6px 8px;
    border: none;
    border-bottom: 1px solid #ddd;
    outline: none;
    font-size: 14px;

    flex: 0 0 auto;   
}

.tab-dropdown-list {
    flex: 1 1 auto;     /* take remaining space */
    overflow-y: auto;   /* enable scroll */
    min-height: 0;      
}

.tab-dropdown-list div {
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
}


.tab-dropdown-list > div {
    background: white;
}
.tab-dropdown-list > div:hover {
    background: #eee;
}

.tab-dropdown-menu {
    background: white;   /* same as items */
    padding: 0;          /* 🔴 important */
}

.tab-dropdown-menu div {
    xpadding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
}

.tab-dropdown-menu div:hover {
    background: #eee;
}