/* CoreTech frontend edit bar — mid-left fixed HOME rail (bypasses web.assets_frontend cache) */

.o_frontend_to_backend_nav.ct-frontend-ribbon {
    top: 50% !important;
    left: 0 !important;
    bottom: auto !important;
    right: auto !important;
    z-index: 1055 !important;
    width: 36px;
    height: 112px;
    min-width: 36px;
    min-height: 112px;
    padding: 0 14px 0 0;
    margin: 0;
    overflow: visible;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%) !important;
    --ct-ribbon-speed: 180ms;
    --ct-ribbon-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

header#top {
    border-top: 0 !important;
}

.o_frontend_to_backend_nav.ct-frontend-ribbon svg.o_frontend_to_backend_icon {
    display: none !important;
}

/* Kill stock triangle / glyph pseudos — face is a real DOM node */
.o_frontend_to_backend_nav.ct-frontend-ribbon::before,
.o_frontend_to_backend_nav.ct-frontend-ribbon::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    background: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Idle face: solid blue tab + rotated HOME label (real element, always paints) */
.o_frontend_to_backend_nav.ct-frontend-ribbon .ct-ribbon-home-face {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 112px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(0, 0, 0, 0.18) !important;
    border-left: none !important;
    border-radius: 0 var(--ct-radius-md, 10px) var(--ct-radius-md, 10px) 0 !important;
    background: linear-gradient(180deg, #4d97e0 0%, #2575cc 45%, #1a5fad 100%) !important;
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.16) inset,
        0 2px 10px rgba(15, 23, 42, 0.28) !important;
    opacity: 1 !important;
    pointer-events: none !important;
    transition: opacity var(--ct-ribbon-speed) var(--ct-ribbon-ease);
}

.o_frontend_to_backend_nav.ct-frontend-ribbon .ct-ribbon-home-face > span {
    display: block !important;
    color: #ffffff !important;
    font-family: var(--ct-font-sans, "Inter", system-ui, sans-serif) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: 0.28em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    transform: rotate(-90deg) !important;
    transform-origin: center center !important;
}

.o_frontend_to_backend_nav.ct-frontend-ribbon:hover .ct-ribbon-home-face,
.o_frontend_to_backend_nav.ct-frontend-ribbon:focus-within .ct-ribbon-home-face,
.o_frontend_to_backend_nav.ct-frontend-ribbon.ct-ribbon-open .ct-ribbon-home-face {
    opacity: 0 !important;
}

/* Stacked Home + Edit panel */
.o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_buttons {
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    z-index: 10 !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    width: 96px !important;
    transform: translate3d(-110%, -50%, 0) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        transform var(--ct-ribbon-speed) var(--ct-ribbon-ease),
        opacity 120ms linear,
        visibility 0s linear var(--ct-ribbon-speed);
}

.o_frontend_to_backend_nav.ct-frontend-ribbon:hover .o_frontend_to_backend_buttons,
.o_frontend_to_backend_nav.ct-frontend-ribbon:focus-within .o_frontend_to_backend_buttons,
.o_frontend_to_backend_nav.ct-frontend-ribbon.ct-ribbon-open .o_frontend_to_backend_buttons {
    transform: translate3d(0, -50%, 0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition-delay: 0ms !important;
}

.o_frontend_to_backend_nav .o_frontend_to_backend_buttons {
    background: #262a32 !important;
    border: 1px solid rgba(0, 0, 0, 0.40) !important;
    border-radius: 0 var(--ct-radius-md, 10px) var(--ct-radius-md, 10px) 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow:
        0 1px 0 0 rgba(255, 255, 255, 0.05) inset,
        0 2px 4px rgba(0, 0, 0, 0.35),
        0 6px 14px rgba(0, 0, 0, 0.30),
        0 12px 28px rgba(0, 0, 0, 0.22) !important;
}

.o_frontend_to_backend_nav .o_frontend_to_backend_buttons > a {
    flex: 0 0 auto !important;
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    position: relative;
    z-index: 12;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.o_frontend_to_backend_nav .o_frontend_to_backend_edit_btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35em !important;
    background-color: transparent !important;
    color: rgba(255, 255, 255, 0.78) !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
    min-width: 0 !important;
    padding: 0 0.65em !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.o_frontend_to_backend_nav .o_frontend_to_backend_edit_btn:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.95) !important;
}

.o_frontend_to_backend_nav .o_frontend_to_backend_edit_btn > img {
    height: 1.25em;
    width: 1.25em;
    margin-right: 0 !important;
    border-radius: 3px;
    object-fit: cover;
}

/* Home — always labeled in the stack (no icon, no width expand) */
.o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_apps_btn.ct-apps-home-btn {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 44px !important;
    padding: 0 0.65em !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    background-color: #2575cc !important;
    background-image: linear-gradient(180deg, #3989dc 0%, #2575cc 50%, #1f6abd 100%) !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: auto !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.08) inset !important;
    transition: background-image 120ms ease !important;
}

.o_frontend_to_backend_nav.ct-frontend-ribbon .ct-apps-home-label {
    display: inline-block !important;
    overflow: visible;
    max-width: none !important;
    opacity: 1 !important;
    margin-left: 0 !important;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #ffffff !important;
    transition: none;
}

.o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_apps_btn.ct-apps-home-btn:hover,
.o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_apps_btn.ct-apps-home-btn:focus-visible,
.o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_apps_btn.ct-apps-home-btn.ct-home-expanded {
    width: 100% !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    padding-right: 0.65em !important;
    background-image: linear-gradient(180deg, #4d97e0 0%, #3989dc 50%, #2575cc 100%) !important;
}

.o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_apps_btn.ct-apps-home-btn:hover .ct-apps-home-label,
.o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_apps_btn.ct-apps-home-btn:focus-visible .ct-apps-home-label,
.o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_apps_btn.ct-apps-home-btn.ct-home-expanded .ct-apps-home-label {
    max-width: none !important;
    opacity: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
    .o_frontend_to_backend_nav.ct-frontend-ribbon .ct-ribbon-home-face,
    .o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_buttons,
    .o_frontend_to_backend_nav.ct-frontend-ribbon .o_frontend_to_backend_apps_btn {
        transition: none !important;
    }
}
