.auto-card-grid {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-start;
    margin-bottom: 75px
}

/* Mobile: 1 per row */
.auto-card-grid .card {
    flex: 1 1 100%;
    max-width: 100%;
}

/* Tablet: 2 per row */
@media (min-width: 768px) {
    .auto-card-grid .card {
        flex: 1 1 calc(50% - 0.5rem);
    }
}

/* Desktop: 3 per row */
@media (min-width: 1024px) {
    .auto-card-grid .card {
        flex: 1 1 33.333%;
    }
}

/* Equal height support */
@media (prefers-color-scheme: dark) {
    .connector-card {
        border: 2px solid #050505 !important;
    }
    .sense-card {
        border:2px solid #050505 !important;
    }
}

.sense-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* box-shadow: none !important; */
    border-radius: 20px !important;
    border:2px solid #e3e1e1;
}
.sense-card .card-header.flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 10px;
}
.sense-card .card-header.flex .button {
    font-size: 0.9rem;
}
.sense-card .card-content {
    flex-grow: 1;
}
.sense-card .card-footer {
    padding-right: 10px;
    padding-block: 5px;
    display: flex;
    justify-content: flex-end;
}
.sense-enter, .sense-delete {
    /* color:rgb(0, 123, 255); */
}



.connector-card {
    /* box-shadow: none !important;
    border-radius: 20px !important;
    border:2px solid #e3e1e1; */
}





.modal-card-body {
    padding: 20px;
}


.sense-content .content p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0; /* remove extra spacing if needed */
}

#file-dropzone {
    border: 2px dashed #ccc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    color: #555;
    background-color: #fafafa;
    transition: background-color 0.3s ease;
}

#file-dropzone.bg-light {
    background-color: #e8e8e8;
}

.file-list {
    margin-top: 20px;
    list-style: none;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
}

.file-list-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border-bottom: 1px solid #ececec;
    position: relative;
}

.file-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-item-name {
    flex-grow: 1;
    margin-left: 8px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-status {
    font-size: 12px;
    color: #999;
    margin-right: 10px;
}

.remove-file-btn {
    cursor: pointer;
}

progress.progress {
    width: 100%;
    margin-top: 8px;
    height: 8px;
}


#sheets-dropzone {
    position: relative;
    border: 2px dashed #ccc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    color: #555;
    background-color: #fafafa;
    transition: background-color 0.3s ease;
}

#sheets-dropzone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

#sheets-dropzone.bg-light {
    background-color: #e8e8e8;
}

.sheets-list {
    margin-top: 20px;
    list-style: none;
    padding: 0;
    max-height: 250px;
    overflow-y: auto;
}

.sheets-list-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border-bottom: 1px solid #ececec;
    position: relative;
}

.sheets-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sheets-item-name {
    flex-grow: 1;
    margin-left: 8px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-status {
    font-size: 12px;
    color: #999;
    margin-right: 10px;
}

.remove-sheets-btn {
    cursor: pointer;
}



.ribbon {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    width: 75px;
    height: 75px;
    z-index: 1;
}

.ribbon.ribbon-top-left span {
    position: absolute;
    display: block;
    width: 130px;              /* Slightly wider so text fits horizontally */
    padding: 5px 0;
    background: linear-gradient(135deg, #000000, #333333);
    color: #ffffff;
    text-align: center;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    transform: rotate(-45deg);
    transform-origin: 0 0;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    top: 47px;
    left: -45px;
}


.upload-label {
    background-color: #f4e3d3;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.upload-zone {
    background-color: #fef6ed;
    border: 2px dashed #d3a675;
    padding: 1rem;
    border-radius: 6px;
    color: #a5693c;
    text-align: center;
    transition: background-color 0.3s;
}

.upload-zone:hover,
.upload-zone.dragover {
    background-color: #fbe9d3;
    cursor: pointer;
}

.upload-file-list {
    background-color: #fff5eb;
    border: 1px solid #e5c1a1;
    padding: 0.75rem;
    border-radius: 6px;
    color: #5a3921;
    list-style: none;
}

.upload-file-list li {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e0bfa0;
    position: relative;
}

.upload-file-list li:last-child {
    border-bottom: none;
}

.upload-file-list .delete {
    position: absolute;
    right: 10px;
    top: 10px;
    background: red;
    border: none;
}


.menu-list button.session-menu-button {
    background: transparent !important;
    border: none            !important;
    border-radius: 0        !important;
    padding: 0              !important;
    margin: 0               !important;
    width: auto             !important;
    color: #252830;
}


.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    cursor: pointer;
}
.session-item:hover {
    background-color: #f5f5f5;
}
.session-item a.sense-session {
    flex: 1;
    text-decoration: none;
    color: #252830;
}

.session-menu {
    position: relative;
    margin-left: 8px;
}

.menu-list li .session-menu-dropdown {
    padding-inline-start: 0 !important;
    border-left: 1px solid #ccc !important;
    margin: 0 !important;
}

.session-menu-dropdown {
    display: none;              /* toggled by JS */
    position: absolute;         /* remove from normal flow */
    top: calc(100% + 4px);      /* just below the button */
    right: 0;
    width: 180px;
    height: 100px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 1000;              /* sit on top */
    margin: 0;                  /* reset old margins */
    padding: 0;
    overflow: hidden;
    padding-inline-start: 0;
    list-style: none;
}



.session-item {
    overflow: visible;
}

.session-menu-dropdown li {
    list-style: none;
}

.session-menu-dropdown li + li {
    border-top: 1px solid #eee;
}

.session-menu-dropdown li a {
    display: flex;
    align-items: center;
    height: 50px;            /* 2 items × 50px = 100px */
    padding: 0 16px;
    text-decoration: none;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    padding: 0 16px;
}

.session-menu-dropdown li a i {
    margin-right: 12px;
    font-size: 16px;
}

.session-menu-dropdown .delete-action {
    color: #d9534f !important;
}

.session-menu-dropdown .delete-action i {
    color: #d9534f !important;
}

.session-menu-dropdown .delete-action:hover {
    background: #fdecea;
}



.session-menu-dropdown .rename-action a:hover {
    background: #fdecea;
}

.rename-input {
    flex: 1;
    padding: 4px 8px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

@media (prefers-color-scheme: dark) {
    .session-menu-dropdown {
        background-color: var(--bulma-scheme-main, hsl(220, 15%, 12%));
        border-color: var(--bulma-scheme-main-l, hsl(220, 15%, 10%));
    }

    /* explicitly make all text and icons white */
    .session-menu-dropdown li a,
    .session-menu-dropdown li a i {
        color: var(--bulma-scheme-text, #fafafa) !important;
    }

    .session-menu-dropdown li + li {
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .session-menu-dropdown li a:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .session-menu-dropdown .delete-action:hover {
        background-color: rgba(217, 83, 79, 0.1); /* subtle red */
    }

    .menu-list button.session-menu-button {
        color: var(--bulma-scheme-text, #fafafa) !important;
    }

}



/* make your custom tag render like an inline spinner */
sense_graph.loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite, fadein 0.3s forwards;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* fade‐out before remove */
sense_graph.fade-out {
    animation: fadeout 0.5s forwards;
}
@keyframes fadeout {
    to { opacity: 0; transform: scale(0.8); }
}

.sense-graph-container {
    max-width: 60%;
}

.w-25 {width: 25% !important;}
.w-50 {width: 50% !important;}
.w-75 {width: 75% !important;}
.w-100 {width: 100% !important;}

@media (prefers-color-scheme: dark) {
    .custom-tooltip::after {
        background: #050505 !important;
        color: inherit !important;
        box-shadow:
            rgba(87, 87, 87, 0.08) 0px 0.706592px 0.706592px -0.666667px,
            rgba(87, 87, 87, 0.08) 0px 1.80656px 1.80656px -1.33333px,
            rgba(87, 87, 87, 0.07) 0px 3.62176px 3.62176px -2px,
            rgba(87, 87, 87, 0.07) 0px 6.8656px 6.8656px -2.66667px,
            rgba(87, 87, 87, 0.05) 0px 13.6468px 13.6468px -3.33333px,
            rgba(87, 87, 87, 0.02) 0px 30px 30px -4px,
            rgba(100, 100, 100, 0.5) 0px 2px 1px -1px inset !important;
    }
}



.sidebar-plan-info-container {
    min-height: 64px;
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;

    background: #F5F5F5;

    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.sidebar-plan-info {
    overflow: hidden;
}

.sidebar-plan-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: -webkit-fill-available;
}

.sidebar-plan-icon {
    font-size: 1.4rem;
    color: #ff9e63;
}

.sidebar-plan-texts {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-plan-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: inherit;
}

.sidebar-plan-summary {
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.75rem;
}


/* !!! Always should be in the bottom !!! */
.custom-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    background: inherit;
    color: #282829;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: pre-wrap;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(0,0,0,0.2);
    box-shadow:
            rgba(0, 0, 0, 0.08) 0px 0.706592px 0.706592px -0.666667px,
            rgba(0, 0, 0, 0.08) 0px 1.80656px 1.80656px -1.33333px,
            rgba(0, 0, 0, 0.07) 0px 3.62176px 3.62176px -2px,
            rgba(0, 0, 0, 0.07) 0px 6.8656px 6.8656px -2.66667px,
            rgba(0, 0, 0, 0.05) 0px 13.6468px 13.6468px -3.33333px,
            rgba(0, 0, 0, 0.02) 0px 30px 30px -4px,
            rgb(255, 255, 255) 0px 3px 0.4px 0px inset;
    z-index: 9999;
    transition: opacity 0.2s ease, transform 0.2s ease;
    min-width: 200px;
    max-width: 320px;
}

.custom-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}