/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif; 
    
}

:root {
    --dual-text: #0e7490;
    --top-bg: #F1F5F9 ; /* former #f5f0eb */
    --muted: #334155; /*slate 700 */
    --border: #F1F5F9; /* slate 100 */
    --std-bg: transparent; /* former #F8FAFC */
    --fw-medium: 500;
    --low: #FFFBEB; /* legend dot */
    --moderate: #FEF0E0; /* legend dot */
    --high: #FEE9E9; /* legend dot */
    --list-max-width: 640px;
    --side-global-padding: 1.5rem;
    --main-side-padding: 10rem;
    --nav-height: 4rem; /* replace with your actual nav height */
    --btn-border: #E2E8F0;
    --br-button: 0.5rem;
    
  
  }

/* --- 2. Global Typography (The "Top" of your file) --- */
/* --- 2. Global Typography (The "Top" of your file) --- */
h1, .h1-title {
    font-family: var(--heading-font);
    font-size: clamp(1.07rem, 8vw, 1.13rem); /* The Big Boss */
    line-height: 1.1;
    font-weight: 600;
    padding-bottom: 0.25rem;
}

h2, .h2-title {
    font-size: clamp(0.96rem, 5vw, 1.03rem);
    font-weight: 500;
}

body {
    background: white;
    font-size: 0.93rem;
    color: #0F172A; /* slate 900 */
    min-height: 100vh;
    overflow-y: auto; /* only shows scrollbar when content actually needs it */
    overflow-x: hidden;
}

html, body {
    height: 100%;
   
}


main {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    
}


.title {
    font-size: 1.75rem;        /* 36px */
    font-weight: 700;          /* Bold */
    letter-spacing: -0.025em;  /* Tightens letter spacing */
    line-height: 2.5rem;       /* Standard leading for 4xl */
    margin-bottom: 0.5rem;     /* 8px */
    color: #0f172a;            /* Slate 900 - very dark blue/black */
}


/* prose content */

.prose-content h1, .prose-content .h1-title {
    font-family: var(--heading-font);
    font-size: clamp(1.07rem, 8vw, 1.13rem); /* The Big Boss */
    line-height: 1.1;
    font-weight: 600;
    padding-bottom: 0.25rem;
}

.prose-content h2, .prose-content .h2-title {
    font-size: clamp(0.96rem, 5vw, 1.03rem);
    font-weight: 500;
}

.prose-content h1 {
    margin-bottom: 0.75rem;
}

.prose-content h2 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.prose-content p {
    margin-bottom: 1rem;
}

.icon-success {
    color: #388E3C;
}

/* nav bar */

.sticky-nav {
    /* w-full */
    width: 100%;
    height: var(--nav-height);
    display: flex;
    flex-shrink: 0;  /* ← prevent nav from shrinking */
    
    /* sticky top-0 */
    position: sticky;
    top: 0;

    align-items: center; /* This is the "magic" vertical centering line */
            
    padding: 0 0.05rem;   /* Matches your px-6 horizontal padding */

    /* bg-white/80 (White with 80% opacity) */
    background-color: rgba(255, 255, 255, 0.8);

    /* backdrop-blur-md */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* Safari support */

    /* border-b border-slate-100 */
    border-bottom: 1px solid #f1f5f9; 
    z-index: 10;
}


.logo {
    
    /* px-6 (6 * 4px = 24px) */
    padding-left: 1.5rem;
    padding-right: 0;
    padding-top: 0.0025rem;

    /* text-xl */
    font-size: 1.45rem;    /* 20px */
    line-height: 1.75rem;

    /* font-jakarta */
    font-family: 'Plus Jakarta Sans';

    /* font-bold */
    font-weight: 700;

    /* tracking-tight */
    letter-spacing: -0.025em;
    display: flex;
    text-decoration: none;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Adjust this number (1rem to 2rem) to push the icon away from the logo */
    flex: 1;    /* Allows this group to take up space */
    justify-content: space-between;
}

.nav-right-container {
    display: flex;
    margin-right: 1.5rem;
    gap: 0.5rem;
    
}
.mobile-trigger { 
    display: flex; 
    background: none; 
    border: none; 
    font-size: 1.1rem; /* Slightly smaller often looks "cleaner" next to logos */
    cursor: pointer;
    padding: 8px;      /* Adds a touch target so it's easier to click */
    color: #475569;    /* Slate-600 color for a premium look */
    flex-direction: row;
    flex: 1;
    justify-content: space-between;
}

.icon-btn {
    border: none;
    color: #475569;
    background: none;
}

/* The Search Overlay */
.mobile-search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: none; /* Hidden until clicked */
    align-items: center;
    padding: 0 1rem;
    z-index: 50;
    }

.paste-btn {
    border: none;
    background: none;
    color: #475569;
    margin-right: 1.5rem;
}

/* Ensure the search box expands to fill the bar */
.mobile-search-overlay .search-box {
    display: flex;
    flex: 1;                  /* Forces it to take up all available space */
    align-items: center;
    background: #f8fafc; /* slate 50 */
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    border: 0.0625rem solid #E2E8F0;
    box-sizing: border-box;
    /* The Switch */
    height: 2rem; /* Your exact height, now as a floor */
    margin-left: 0.85rem;

    /* Width Note */
    min-width: 18rem;

}

.mobile-search-overlay.active {
    display: flex;
}

/* Search History Positioning */
.search-history {
    position: absolute;
    top: 3.25rem; /* Exactly below the nav */
    left: 0;
    width: 100%;
    background: white;
    border-bottom: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    padding: 1rem;
    display: none;
}

#searchInput:focus + .search-history, 
.search-history:active {
  display: block; /* Show history when input is focused */
}


.search-box {
    display: none; /* Show on big screens */
}

/* When the input inside becomes active... */
.search-box:focus-within {
    border-color: #cbd5e1; /* This is Tailwind's slate-300 */
}

.search-box::placeholder {
    font-size: 0.0125rem;
}

.search-box input {
    background: transparent;   /* Makes input see-through to show div bg */
    border: none;              /* Removes the default ugly square border */
    outline: none;             /* Removes the blue ring when clicking */
    width: 100%;               /* Fills the container */
    padding: 0.25rem 0.5rem;
    
}

.fa-magnifying-glass {
    /* text-slate-400 equivalent */
    color: #475569; 
    
    /* Controlling size */
    font-size: 0.875rem; 
    
    /* Spacing it away from the input text */
    margin-right: 0.2rem;
    margin-left: 0.2rem; 

    padding-top: 0.15rem;
    
    /* Critical for FontAwesome 'solid' icons */
    font-weight: 900; 
}


/* Styling the Link (blue) */

.nav-link,
.a.nav-link
{
    display: none;
}

.drawer-btn {
    display: none;
}

/* Drawer Logic */
.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    background-color: #fff;
    z-index: 100;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    transform: translateX(100%);
    width: 100%;
}


.drawer.active { transform: translateX(0); }

/* Drawer Interior */
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #f8fafc;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    background: none;
    border: none;
    cursor: pointer;
}

.icon-w6 { width: 1.5rem; height: 1.5rem; }

.back-text, .label-caps, .clear-btn {
   
    font-weight: 500;
    letter-spacing: 0.025rem;
}


.back-link:hover {
    color: #0F172A;
}

.drawer-body {
    flex: 1;
    padding: 1rem 2rem 1rem 2rem;
    display: flex;
    flex-direction: column;
}

.drawer-input {
    flex: 1;
    width: 100%;
    font-weight: 300;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    margin-top: 0.875rem;
    outline: none;
    resize: none;
    padding: 1rem;

    /* Force the scrollbar when text overflows */
    overflow-y: auto; 
    
    /* Optional: prevents the box from being too tiny initially */
    min-height: 300px;
    max-height: 500px;  /* Stops growing here */

    /* 4. scrollbar-thin (Standard & Firefox) */
    scrollbar-width: thin;
    
}

.drawer-input:hover {
    border: 1px solid #CBD5E1;
}

/* 4. Webkit (Safari/Chrome) Scrollbar styling */
.drawer-input::-webkit-scrollbar {
    width: 6px; /* Makes it "thin" */
}

.drawer-input::-webkit-scrollbar-thumb {
    background-color: #e2e8f0; /* slate-200 for a subtle look */
    border-radius: 8px;
}

/* placeholder:text-slate-300 */
.drawer-input::placeholder {
    color: #cbd5e1;
    opacity: 1; /* Ensures color shows correctly in Firefox */
    
}

.drawer-footer {
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


.clear-btn {
    background: none;
    border: none;
    
    font-weight: 500;
    letter-spacing: 0.025rem;
    cursor: pointer;
    color: #475569;
}

.clear-btn:hover {
    color: #0F172A;
}

/* Overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    /* backdrop-filter: blur(2px); */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
    z-index: 90;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* analyze button */

.paste-container {
    display: flex;
    justify-content: flex-end; /* Pushes content to the right */
    width: 100%;               /* Ensures the container spans the full width */
    margin-top: 0.5rem;       /* mt-3 equivalent */
}

#analyze-btn {
    /* Layout & Sizing */
    display: flex;

    /* Center vertically */
    align-items: center;
    
    /* Center horizontally */
    justify-content: center;

    /* Ensure no padding is pushing the icon off-center */
    padding: 0;

    height: 2.75rem; /* h-11 */
    width: 2.75rem;  /* w-11 */
    
    margin-top: 0.75rem; /* mt-3 */

    /* Visuals */
    background-color: #94A3B8; /* bg-slate-400 */
    
    border-radius: 0.75rem; /* rounded-xl */
    border: none;
    cursor: pointer;
    
  /* Transitions */
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.paste-container .fa-magnifying-glass {
    color: white;
    align-items: center;
    margin-left: 0.25rem;
}

/* Icons/Text inside */
#analyze-btn i {
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25rem;
}

/* Container for positioning */
.flex.justify-end {
    display: flex;
    justify-content: flex-end;
}

/* States (Focus & Focus-within) */
#analyze-btn:focus,
#analyze-btn:focus-within {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #64748b; /* border-slate-500 */
    box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.1); /* ring-1 ring-slate-500/10 */
}

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 1rem;
}

.error-page h1 {
    font-size: 4rem;
    font-weight: 700;
    color: #0F172A;
}

.error-page p {
    font-size: 1rem;
    color: #64748b;
}

.error-page a {
    font-size: 0.9rem;
    color: #0F172A;
    text-decoration: underline;
}


@media (min-width: 834px) {

        .content-wrapper { 
            
            
            justify-content: center;
            padding: 0 var(--main-side-padding);   /* Creates that empty space on the sides */
            overflow-y: hidden; /* Safety net to kill the scrollbar */
            
            
        }

        
        .nav-right-container .mobile-trigger,
        .nav-right-container .paste-btn { display: none; }
        .mobile-search-overlay { display: none; }
        

        .nav-container .nav-brand-group {
            display: flex;
            align-items: center; /* Vertically centers logo and search */
                   
            width: 90%;         /* Ensures it doesn't collapse */
            gap: 1.5rem;         /* Puts space between logo and search */
        }


        .nav-container {
            /* mx-auto */
            margin-left: 0.0125rem;
            margin-right: auto;
            margin-top: 0.3rem;
            margin-bottom: 0.3rem;

            /* h-16 */
            height: 3rem; /* 64px */
            display: flex;
            flex: 1;

            /* items-center */
            align-items: center;

            /* justify-between */
            justify-content: space-between;

          
        }

        .logo {
            margin-left: 1.5rem;
            margin-right: 1rem;
        }

        .icon-btn, .paste-btn {
            display: none;
        }

        .search-box input::placeholder {
            font-size: 1rem;
        }

        /* Styling the Link (blue) */
        .nav-link, .drawer-btn {
           
            text-decoration: none;   /* Removes the default underline */
            transition: color 0.2s ease; /* Makes the color change smooth */
            list-style: none;      /* Removes the bullet */
            cursor: pointer;
            font-weight: 500;        /* Matching your previous bold style */
            
            transition: color 0.2s ease;
            border: none;
            background: none;
            letter-spacing: 0.025rem;
            margin-right: 1rem;
            color: #475569;
            display: inline-flex;
            align-items: center;
            white-space: nowrap;  /* Prevents the text from breaking into two lines */
            width: auto;          /* Ensures it doesn't try to fill 100% of a cramped space */
            
        }

        .nav-link a:hover, .drawer-btn:hover {
            color: #0F172A;    /* black on hover */
        }


        .drawer { width: 450px; } /* Fixed width for desktop */

        .search-box {
            
            position: relative;
            display: flex;
            flex-direction: row;
            align-items: center;
            background: #F8FAFC; /*slate 50*/
            border-radius: 8px;
            padding: 0.05rem 0.5rem;
            
            border: 0.0625rem solid #E2E8F0;
            box-sizing: border-box;
            
            /* The Switch */
            min-height: 0.325rem; /* Your exact height, now as a floor */
            height: auto;        /* Allows expansion only if needed */
            
            /* Width Note */
            min-width: 18rem;
            
        }

            
        }

/* nav bar end*/

/* result report start */

.result-and-share {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-report {
    display: inline-flex;
    align-items: center;
    width: 100%;
    margin: 2rem 0 2rem 0;
    text-align: left;
    line-height: 1rem;
    background-color: transparent;
    padding: 0.375rem 0;
    gap: 8px;
}

/* share button */

#share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.375rem 0.5rem;
    border-radius: var(--br-button);
    border: 1px solid var(--btn-border);
    background: transparent;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text);
    transition: background 0.2s;

}

#share-feedback {
    margin-left: 0.45rem;
}

/* result report end */

.content-wrapper { /* culprit */
    margin-top: 0.025rem;
    margin-right: 1.5rem;
    margin-left: 1.5rem;
    min-height: calc(100vh - var(--nav-height));
    display: flex;          /* ← add this */
    flex-direction: column; /* ← add this */
}

/* archive tags start*/

/* Layout Container */
.archive-section {
    background: white;
    padding: 1rem 0;
    margin-top: 1rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

 .breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 0px; /* Small gap to show the 'cut' */
    margin-bottom: 0.5rem;
}

/* Base Crumb Styling */
.crumb {
    position: relative;
    padding: 6px 20px 6px 15px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
    background: #F1F5F9; /* slate 100 */
    color: #475569;
}

/* First item doesn't need the left-side notch */
.crumb-first {
    padding-left: 12px;
    clip-path: polygon(calc(100% - 10px) 0%, 100% 50%, calc(100% - 10px) 100%, 0% 100%, 0% 50%, 0% 0%);
    border-radius: 0px 0 0 0px;
}

/* Last item doesn't need the right-side point */
.crumb-last {
    padding-right: 12px;
    clip-path: polygon(100% 0%, 100% 50%, 100% 100%, 0% 100%, 10px 50%, 0% 0%);
    border-radius: 0 0px 0px 0;
    background: #eff6ff; /* blue 50 */
    color: #003595;
}

.crumb:hover {
    filter: brightness(0.92);
}

/* archive tags end */

/* product picture */
.content-wrapper .product-container {
    display: block;
    flex-direction: column; /* Stack items vertically */
    align-items: center;    /* Center items horizontally */
    text-align: left; 
    max-width: 640px;       /* Common mobile width */
    
}

.image-container {
    width: 100%;
    justify-content: center;
}


.product-img {
    height: auto;      /* Maintains the original aspect ratio */
    max-width: 18.75rem;  /* equals 300px; optional: prevents it from getting too huge */
    width: 100%;     /* The "Fluidity" (lets it shrink on small phones) */
    object-fit: contain;
    object-position: center; /* Tries to pull the bottle to the middle */
    display: block;
    margin: 0 auto;
}

.product-header {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.product-title {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.product-brief-desc {
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* where to buy starts*/

/* Container & Button */
.buy-container { 
    position: relative; 
    display: inline-block; 
    text-align: left; 
    width: 80%;
    margin-top: 0.8rem;
    /* Minimum 250px, grows with screen, Maximum 350px */
    width: clamp(250px, 30vw, 350px);
}

.buy-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    color: white;
    border: none;
    cursor: pointer;
    background-color: #94A3B8;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    width: 100%; 
    justify-content: space-between;
}


.buy-btn:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.buy-btn:active { transform: none; }

/* The Dropdown "Rolling" Logic */
#merchantDropdown {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 16rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    z-index: 50;
    overflow: hidden;

    width: 100%;

    /* THE TRICK: Use visibility instead of display */
    visibility: hidden; 
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

/* The Active State */
#merchantDropdown.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* The "End" position (Visible) */
#merchantDropdown.show-roll {
    display: block; /* We handle the display toggle in JS */
}

#merchantDropdown.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Merchant Styling */
.dropdown-header {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.header-text { /* available at */
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    color: #94a3b8;
}



.merchant-item:hover { background-color: #f8fafc; }

.merchant-item i:first-child { color: #94a3b8; transition: color 0.2s; }
.merchant-item:hover i:first-child { color: #163832; }

.merchant-item span { font-size: 0.875rem; font-weight: 600; color: #334155; }



.merchant-item:hover .arrow-right { transform: translateX(0.25rem); }

.merchant-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1.06rem;
    padding-right: 0.8rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    text-decoration: none;
    transition: background-color 0.2s;
    justify-content: space-between;
    width: 100%;
}

.merchant-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

/* THE PILL LOGIC */
.price-pill {
    
    background-color: #f1f5f9; /* Light gray (Slate-100) */
    color: #475569;            /* Medium gray text */
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;     /* Makes it a pill shape */
    border: 1px solid #e2e8f0;
    
}


.merchant-item:hover .price-pill {
    background-color: #e2e8f0; /* Darkens slightly on hover */
}

/* popover functions start */

.notice {
    position: relative;
    display: inline-block;
    
}

.subheader-info {
    font-size: 0.9rem;
    color: #64748B;
    margin-top: 0.15rem;
}

.ing-count {
    font-weight: 700;
    color: #475569;
}

.open-info-first {
    display: inline-flex;
    align-items: center;      /* Centers vertically */
    justify-content: center;   /* Centers horizontally */
    cursor: pointer;

    /* Using equal width and height for a perfect circle */
    width: 0.9rem;
    height: 0.9rem;

    /* border-radius: 50% is safer for perfect circles than a fixed 0.5rem */
    border-radius: 50%; 
    border: 1.2px solid #64748B;
    
    font-size: 0.6rem;
    font-weight: 700;
    
    /* REMOVE THIS: it pushes the 'i' to the right */
    /* padding-left: 0.35rem; */
    padding: 0; 

    /* OPTIONAL: Nudge for "Optical Centering" */
    /* Lowercase 'i' often looks too high because of the dot. 
       A tiny bit of padding-bottom can make it look 'right' to the eye. */
    padding-bottom: 1px; 
    line-height: 0;
}


.popover-arrow {
    
    /* absolute */
    position: absolute;

    /* -top-1.5 (approx -6px) */
    top: -6px;

    /* left-6 (1.5rem or 24px) */
    left: 1.5rem;

    /* w-3 h-3 (12px by 12px) */
    width: 12px;
    height: 12px;

    /* bg-white */
    background-color: #ffffff;

    /* border-t border-l border-slate-200 */
    border-top: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;

    /* rotate-45 */
    transform: rotate(45deg);

    /* Ensure it sits behind the border of the main card if needed */
    z-index: -1; 
}

.popover-info.hidden {
    display: none;
}

.popover-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* 8px */
   
    
    position: absolute;
    
    
    /* top-full */
    top: 100%;

    /* left-0 */
    left: 0;

    /* mt-3 */
    margin-top: 0.75rem; /* 12px */

    /* w-72 */
    width: 18rem; /* 288px */

    /* Recommended: Ensure it stays above other elements */
    z-index: 50;

    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 0.8rem;

    /* shadow-xs */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 0.8rem;
}

.entry-animation {
    /* duration-200 */
    animation-duration: 200ms;
    
    /* animate-in / timing function */
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: forwards;
    
    /* Combining fade-in and zoom-in */
    animation-name: fadeInZoomIn;

    /* Makes the zoom grow 'downward' from the trigger button */
    transform-origin: top;
}

@keyframes fadeInZoomIn {
    from {
        /* fade-in (opacity 0) */
        opacity: 0;
        /* zoom-in (starts at 95% scale) */
        transform: scale(0.95);
    }
    to {
        /* end state */
        opacity: 1;
        transform: scale(1);
    }
}

.close-btn-absolute {
    /* absolute top-3 right-3 */
    position: absolute;
    top: 0.75rem;   /* 12px */
    right: 0.75rem; /* 12px */

    /* text-slate-400 */
    color: #94a3b8;

    /* Reset button defaults */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px; /* Makes it easier to click */
    
    display: flex;
    align-items: center;
    justify-content: center;

    top: 4px;   /* Move it closer to the top edge */
    right: 8px; /* Standard spacing from the right */

    /* Smooth transition for the hover effect */
    transition: color 0.2s ease;
}

/* hover:text-slate-600 */
.close-btn-absolute:hover {
    color: #475569;
}

/* h-4 w-4 (for the SVG inside) */
.close-btn-absolute svg {
    width: 1rem;  /* 16px */
    height: 1rem; /* 16px */
}

/* This class "wakes up" the popover */
.popover-info.is-visible {
    display: flex;
}

.popover-title {
    /* text-slate-800 */
    color: #0F172A; /*slate 900 */
    /* font-bold */
    font-weight: 500;
    font-size: 0.9rem;
    /* mb-1.5 */
    margin-bottom: 0.375rem; /* 6px */
    /* Recommended to ensure the margin is respected */
    display: block;
}


.reg-reg-link {
    /* underline */
    text-decoration: underline;

    /* cursor-pointer */
    cursor: pointer;

    /* default state (usually paired with slate-400 or 500 in your previous examples) */
    

    /* smoothing the transition */
    transition: color 0.2s ease;
}

/* popover functions end */

/* function boxes */

/* EXPANDABLE CARD TRIAL START */
.map-box-wrapper { display: none; }

/* mobile */

.panel { width: 100%; max-width: var(--list-max-width); }

  /* ── ACCORDION ── */
  .group-list {
    margin-top: 20px;
    border-top: 1px solid #F1F5F9;
    
    border-radius: 0;
    overflow: hidden;
  }

  .group-row { border-bottom: 1px solid #F1F5F9; }
  .group-row:last-child { border-bottom: none; }

  /* one-line peek */
  .row-peek {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.12s;
    user-select: none;
  }
  

  .row-label {      /*eg humectant, etc...*/
    font-size: 0.9rem;
    font-weight: var(--fw-medium);
    color: var(--muted);
    white-space: nowrap;
    min-width: 90px;
    flex-shrink: 0;
  }

  /* fading chip preview */
  .row-chips-peek {
    flex: 1;
    overflow: hidden;
    mask-image: linear-gradient(to right, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 60%, transparent 100%);
    padding-left: 0.5rem;  /* ← add this */
  }

  .chips-scroll {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    pointer-events: none;
  }
  
  .chips-scroll::-webkit-scrollbar { display: none; }

  .row-count {
    margin-left: auto; /* ← add this */
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .row-arrow {
    font-size: 0.8rem;
    color: var(--muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }
  .group-row.open .row-arrow { transform: rotate(180deg); }

  .group-row.open .row-chips-peek {
  display: none;
} /* hide sneak peeks when collapsing */

  /* expand / collapse */
  .row-expand {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.22s ease;
    background: transparent;
  }
  
  .group-row.open .row-expand {
    grid-template-rows: 1fr;
    border-top-color: var(--border);
  }
  .row-expand-inner { overflow: hidden; }

  .chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 14px 12px;
  }

  /* ── CHIPS ── */
  

 
  /* matches your: dual-highlight */
  .chip.dual-highlight {
    background: var(--dual-bg);
    border-color: var(--dual-border);
    color: var(--dual-text);
  }

  /* matches your: top_position-highlight */
  .chip.top_position-highlight {
    background: var(--top-bg);
    border-color: var(--top-border);
  }


  /* scoring legend start */



.legend-safety {
    display: flex;
    gap: 12px;
    margin: 2rem 0 0 0;
}

.legend-dot.low      { background: var(--low); } /* green */
.legend-dot.moderate { background: var(--moderate); } /* yellow */
.legend-dot.high     { background: var(--high); } /* red */

  /* scoring legend end */

  /* ── LEGEND ── */
  .legend {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    padding: 0 2px;
  
  }
  .legend-item {
    display: flex;
    font-size: 0.8rem;
    align-items: center;
    gap: 5px;
    
    color: var(--muted);
  }
  .legend-dot { width: 8px; height: 8px; border-radius: 50%; }
  .legend-dot.top  { background: var(--top-bg); }
  .legend-dot.dual { background: var(--dual-text); }
  .legend-dot.base { background: var(--chip-border); }


/* expandable card function end mobile*/


/* expandable card function start desktop */

@media (min-width: 834px) {


/* ── masonry grid ── */
.panel {display: none;} /*mobile */

 /* 1. The Container */
.map-box-wrapper {
  display: grid;
  margin-top: 1rem;
  /* Creates 3 equal columns, or collapses to 1 on small screens */
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2.5rem;
  align-items: start; /* Prevents cards from stretching to match the tallest sibling */
  width: 100%;
}

.card-ing-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* and rename .card hover/base styles to .card-wrapper */
.card-wrapper {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
padding: 16px;
display: flex;
flex-direction: column;
gap: 2px;
align-self: start;
cursor: pointer;
transition: box-shadow 0.15s, border-color 0.15s;
}

.chip-more {
display: inline-flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
background: transparent;
color: var(--muted);
margin-top: 4px;
}

.pos {
    opacity: 0.45;
  }

 /* change .card.open to .card-wrapper.open */
.card-wrapper.open .chip-extra { display: inline-flex; }
.card-wrapper.open .chip-more  { display: none; }
.card-wrapper.open .show-less  { display: block; color: #94A3B8; margin-top: 1px;}
.card-wrapper.no-overflow .chip-more { display: none; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.func-sq {
    display: block;
    width: 12px;
    height: 12px;
    min-width: 12px; /* Prevents flex-box from squishing it to 0px */
    min-height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
    margin-bottom: 0.5rem;
    background-color: gray; /* fallback */
}

.group-list .row-peek .func-sq-mobile {
    display: block;
    width: 12px;
    height: 12px;
    min-width: 12px; /* Prevents flex-box from squishing it to 0px */
    min-height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
    margin-bottom: 0rem;
    
    
}

.func-header-wrapper {display:flex; align-items:center; gap:8px;}

.card-header {
  font-weight: var(--fw-medium);
  margin-bottom: 0.5rem;
}

.card-count {
  color: #94A3B8; /* slate 400 */
  background: #F1F5F9;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.card-ing.dual-highlight { color: var(--dual-text); }
.card-ing.top_position-highlight { background-color: var(--top-bg); }

.card-ing {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin: 4px 0;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--std-bg); /* slate 100 */
  color: var(--text);
  font-size: 0.93rem;
}

/* hide extras by default */
.card-ing.chip-extra {
  display: none;
}

/* show when card is open */
.card-wrapper.open .card-ing.chip-extra {
  display: inline-flex;
}

/* show less hint */
.show-less {
display: none;
color: var(--muted);
}
 

/* ── legend ── */
/* 2. The Legend (Span it across all 3 columns) */
.legend {
  grid-column: 1 / -1; /* This forces the legend to the bottom, full width */
  display: flex;
  gap: 12px;
  margin-top: 10px; /* Push it away from the cards */
  padding-top: 15px;

}

.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.7rem; color: var(--muted); }
.ldot { width: 7px; height: 7px; border-radius: 50%; }
.ldot.top  { background: var(--top-bg); }
.ldot.dual { background: var(--dual-text); }
.ldot.base { background: var(--chip-border); }

.card-wrapper {
  padding: 1.5rem;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem; 
}

}

/* position highlight */




/* 3. Responsive Tweak */
@media (max-width: 900px) {
  .map-box-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .map-box-wrapper {
    grid-template-columns: 1fr;
  }
}

/* expandable card function end desktop */



/* found count & inci list */

/* Default style for all ingredients */
.ingredient-tag {
    padding: 2px 6px;
    border-radius: 4px;
    margin: 2px;
    display: inline-block;
}

/* Highlighting specific safety hazards in Safety View */
.view-safety .ing-name .sflag {
    
    border-bottom: 2px dashed #856404;
    font-weight: bold;
}

.separator {
    margin-right: 4px;
    color: #555;
}

.subtabsection-wrapper {
    border-top: 1px solid #E2E8F0; /* slate 400 */
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    display: block;
}


.list-wrapper {
    margin-bottom: 0.8rem;
    margin-top: 0.5rem;
}

.inciheadert-wrapper {
    display: inline-flex;
    padding-top: 0.8rem;
}

.inci-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    padding-top: 0.5rem;
}

.inci-toggle {
    display: flex;
    background: #F1F5F9;
    row-gap: 0.5rem;
    margin-top: 0.2rem;
    border-radius: 0.5rem;
    border: 1px solid #F1F5F9;
    font-size: 0.95em;
    margin-bottom: 0.8rem;
}

.inci-container {
    border: 1px solid #E2E8F0; /* slate 200 */ 
    padding: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    
}

.ingredient-container {
    text-align: left;
    line-height: 1.8;
    color: #333;
    
}

.ing-unit { 
    display: inline-block; /* Helps with spacing */
    margin-bottom: 4px;    /* Vertical gap between rows */
    margin-right: 4px;
    white-space: nowrap; /* Prevents a single pill from breaking internally */
}

.ing-name {
    display: inline;
    white-space: normal;
    
   /* Prioritize spaces over dashes for wrapping */
    line-break: strict; 
    word-break: normal; 
    overflow-wrap: break-word;

    /* Keep the background and padding as you have them */
    padding: 2px; 
    border-radius: 4px;
    line-height: 1.8;
}

.comma {
    margin-right: 2px; /* Control the gap AFTER the comma here */
    margin-left: 2px;
    display: inline;
}

.functional-toggle {
    /* px-3 py-1.5 */
    padding: 0.375rem 0.75rem; /* 6px top/bottom, 12px left/right */
    font-weight: 600;
    line-height: 1.25rem;
    
    border-radius: 0.5rem; /* rounded-lg */
    /* border border-stone-100 */
    border: 1px solid #F1F5F9; /* Stone 100 hex */
    /* Alignment fixes for buttons */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.functional-toggle-active {
    /* bg-white */
    background-color: #ffffff;
     /* shadow-sm */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-color: #F1F5F9;
}

.functional-toggle-inactive {
    background-color: #F1F5F9;
    
}

.safety-toggle {
    /* px-3 py-1.5 */
    padding: 0.375rem 0.75rem; /* 6px top/bottom, 12px left/right */
    line-height: 1.25rem;
    font-weight: 600; /* font-semibold */
    border-radius: 0.5rem; /* 8px */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent; /* Base for future borders */
    cursor: pointer;
    transition: all 0.2s ease;
    color: #475569;
}

.safety-toggle-active {
    background-color: #da5269;
    color: white;
}

.safety-toggle-inactive {
    background-color: #F1F5F9;
    
    
}

.copyinci {
    /* flex items-center gap-2 */
    display: flex;
    
    /* Constraints */
    min-width: fit-content;
    width: auto; /* Let it grow to fit the horizontal content */ 
    
    margin-bottom: 0.25rem;

    flex-direction: row;
    align-items: center;
    column-gap: 0.5rem; /* 8px */

    /* px-3 py-1.5 */
    padding: 0.375rem 0.5rem;

    /* border border-slate-300 rounded-lg */
    border: 1px solid var(--btn-border);
    border-radius: var(--br-button); /* 8px */

    font-size: 0.85em;
    font-weight: 700;
    color: #64748b; /* text-slate-500 */
    
    /* transition-all */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Reset for buttons */
    background-color: transparent;
    cursor: pointer;
    }

/* Size the SVG icon */
.copyinci svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0; /* Prevents the icon from squishing */
}

.copybtn-text {
    letter-spacing: 0.05em;
    display: block;
    font-size: 0.95em;
    white-space: nowrap;
    line-height: 1.2;
}

/* inci highlight */

/* function header color start*/

/*
.row-label.humectant,
.row-label.emollient,
.row-label.occlusive {
    color: #4a6fa5;
}


.row-label.fragrance,
.row-label.colorant { 
    color: #c0392b; 
}


.row-label.botanicals,
.row-label.ferments { 
    color: #1e8449; 
}


.row-label.active { 
    color: #b7770d; 
}


 
.row-label.rheology_texture, 
.row-label.film_former, 
.row-label.emulsifier, 
.row-label.ph_adjuster, 
.row-label.preservative { 
    color: #6d6560; 
}


.row-label.solvent { 
    color: #6c3483; 
}


.row-label.cleansing, .row-label.surfactant { 
    color: #7d3c98; 
}


.row-label.uv_filter { 
    color: #b7860d; 
}
*/

/* function header color end */

/* Moisturizing Types - Blue */
.func-sq.humectant,
.func-sq.emollient,
.func-sq.occlusive,
.func-sq-mobile.humectant,
.func-sq-mobile.emollient,
.func-sq-mobile.occlusive
{background-color:  rgba(186, 220, 255, 0.45);}


#forensic-list.view-functional .ing-name.humectant, 
#forensic-list.view-functional .ing-name.emollient, 
#forensic-list.view-functional .ing-name.occlusive {
  background-color: rgba(186, 220, 255, 0.45); 
}

.func-sq.fragrance,
.func-sq.colorant,
.func-sq-mobile.fragrance,
.func-sq-mobile.colorant
{background-color: rgba(254, 222, 222, 0.855);}


/* Aesthetic/Sensory - Muted Red & Dusty Pink */
#forensic-list.view-functional .ing-name.fragrance, 
#forensic-list.view-functional .ing-name.colorant {
  background-color: rgba(254, 222, 222, 0.855); 
}

.func-sq-mobile.botanicals,
.func-sq-mobile.ferments,
.func-sq.botanicals,
.func-sq.ferments {background-color: rgba(167, 234, 196, 0.5);}


#forensic-list.view-functional .ing-name.botanicals, 
#forensic-list.view-functional .ing-name-ferments { 
    background-color: rgba(167, 234, 196, 0.5); 
} /* Red — protection, safety */

.func-sq-mobile.active,
.func-sq.active {background-color: rgba(240, 200, 130, 0.45);}

#forensic-list.view-functional .ing-name.active { background-color: rgba(240, 200, 130, 0.45); }

.func-sq-mobile.rheology_texture, 
.func-sq-mobile.film_former, 
.func-sq-mobile.emulsifier, 
.func-sq-mobile.ph_adjuster, 
.func-sq-mobile.preservative,
.func-sq.rheology_texture, 
.func-sq.film_former, 
.func-sq.emulsifier, 
.func-sq.ph_adjuster, 
.func-sq.preservative {
  background-color: rgba(220, 214, 205, 0.366); }

#forensic-list.view-functional .ing-name.rheology_texture, 
#forensic-list.view-functional .ing-name.film_former, 
#forensic-list.view-functional .ing-name.emulsifier, 
#forensic-list.view-functional .ing-name.ph_adjuster, 
#forensic-list.view-functional .ing-name.preservative {
  background-color: rgba(220, 214, 205, 0.366); 
}

.func-sq-mobile.solvent,
.func-sq.solvent {
    background-color:rgba(238, 228, 255, 0.478); 
}


#forensic-list.view-functional .ing-name.solvent {
  background-color:rgba(238, 228, 255, 0.478); 
}

.func-sq-mobile.cleansing, .func-sq-mobile.surfactant, 
.func-sq.cleansing, .func-sq.surfactant {background-color: rgba(216, 180, 254, 0.5); }

/* Surfactant */
#forensic-list.view-functional .ing-name.surfactant, 
#forensic-list.view-functional .ing-name.cleansing { 
    background-color: rgba(216, 180, 254, 0.5); 
} /* Sky Blue — clean, fresh */


.func-sq-mobile.uv_filter,
.func-sq.uv_filter {background-color: rgba(252, 211, 77, 0.5); } 

/* UV Filter */
#forensic-list.view-functional .ing-name.uv_filter { background-color: rgba(252, 211, 77, 0.5); } /* Sun Yellow — sun, UV protection */


.view-safety .warning-highlight {
    background-color: rgba(245, 220, 160, 0.4); 
}

    /* inci_box result styling */



/* popover explanation trial start  */

.ingredient-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.popover {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 14px;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-size: 0.85rem;
}

.ingredient-wrapper:hover .popover {
  display: block;
}

.popover {
  display: none;
  position: absolute;
  z-index: 100;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px 16px;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 0.85rem;
}

.tip-row { display: flex; flex-direction: column; gap: 2px; }
.tip-tag { font-size: 0.80rem; font-weight: 500; opacity: 0.7; letter-spacing: 0.04em; margin-bottom: 0.15rem;}
.tip-note { font-size: 13px; line-height: 1.5; }
.tip-divider { border: none; border-top: 0.5px solid rgba(255,255,255,0.15); margin: 6px 0; }

.tooltip {
    display: none;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 100;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.chip:hover .tooltip {
    display: block;
}

/* popover explanation trial end  */


.inci-footnote {  /* under inci box */
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 1rem;
    margin-left: 0.1rem;
}

/* mobile safety table start */
.ingredientsg {
    display: inline-block; /* Helps with touch targets on mobile */
    font-weight: 500;
}

.sg-list {
    line-height: 1.6; /* Better readability for multi-line ingredient lists */
    word-wrap: break-word;
}

/* mobile safety table end */

.no-data-return {
    margin-top: 1rem;
}

.safety-consider {
    display: none;
    border-top: 1px solid #E2E8F0;
    padding: 0.25rem;
}


.safetytab-wrapper-desktop {
    display: none;
}

@media (min-width: 1024px) {

    .safety-section { /* mobile */
        display: none;
    }

    .safetytab-wrapper-desktop {
        display: block;
        margin-bottom: 1rem;
    }

    /* safety table styling trial start */

    .col-ingredients { width: 65%; }
    .col-risk { width: 35%; white-space: nowrap; } /* safety tag */

    /* safety table styling trial end */

    .safety-wrapper-inner {
        margin-bottom: 0.25rem;
        margin-top: 1.25rem;
        width: fit-content;
        font-size: 0.9rem;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        display: block;
    }

    .reaction-table {
        border-radius: 0.75rem; 
        /* border border-gray-200 */
        border: 1px solid #e5e7eb; 

        border-collapse: separate;
        border-spacing: 0;

        /* padding: 1rem; */
        gap: 1rem;
        width: auto;
        min-width: 500px;
        max-width: 1000px;
        table-layout: fixed;
        background-color: transparent;
        overflow: visible;
    }

    .table-head {
        top: 0;
        left: 1;
        background: #E2E8F0; /* slate 200 */
    }

    /* Round the top-left of the very first cell */
    .table-head th:first-child {
        border-top-left-radius: 0.75rem;
    }

    /* Round the top-right of the very last cell */
    .table-head th:last-child {
        border-top-right-radius: 0.75rem;
    }

    /* Target every row in the body except the first one */
    .render-body tr + tr {
        border-top: 1px solid #f9fafb; /* gray-50 */
    }


    .row-wrap {
        display: table-row; /* This is the default, but ensures flex is overridden */
       
    }

    /* 2. Set a consistent width for your labels/cells */
    .thead-label, 
    .render-body td {
        padding: 0.94rem;      /* py-4 px-4 */
        text-align: left;
              
    }

    .render-body tr {
    background-color: transparent; /* Ensure rows don't block the body color */
    border-bottom: 1px solid #E2E8F0; /* slate 200 */
    }

   
    }


/* safety popover start */


.safety-par {
    font-size: 0.8rem;
    color: #64748B;
    margin-top: 0.15rem;
}

.open-info-safety {
    display: inline-flex;
    align-items: center;      /* Centers vertically */
    justify-content: center;   /* Centers horizontally */
    cursor: pointer;

    /* Using equal width and height for a perfect circle */
    width: 0.9rem;
    height: 0.9rem;

    /* border-radius: 50% is safer for perfect circles than a fixed 0.5rem */
    border-radius: 50%; 
    border: 1.2px solid #64748B;
    
    font-size: 0.6rem;
    font-weight: 700;
    
    /* REMOVE THIS: it pushes the 'i' to the right */
    /* padding-left: 0.35rem; */
    padding: 0; 

    /* OPTIONAL: Nudge for "Optical Centering" */
    /* Lowercase 'i' often looks too high because of the dot. 
       A tiny bit of padding-bottom can make it look 'right' to the eye. */
    padding-bottom: 1px; 
    line-height: 0;
}


.popover-info.hidden {
    display: none;
}

.popover-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* 8px */
    position: absolute;
    /* top-full */
    top: 100%;

    /* left-0 */
    left: 0;

    /* mt-3 */
    margin-top: 0.75rem; /* 12px */

    /* w-72 */
    width: 18rem; /* 288px */

    /* Recommended: Ensure it stays above other elements */
    z-index: 50;

    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 0.8rem;

    /* shadow-xs */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 0.8rem;
}


@keyframes fadeInZoomIn {
    from {
        /* fade-in (opacity 0) */
        opacity: 0;
        /* zoom-in (starts at 95% scale) */
        transform: scale(0.95);
    }
    to {
        /* end state */
        opacity: 1;
        transform: scale(1);
    }
}

.close-btn-safety {
    /* absolute top-3 right-3 */
    position: absolute;
    top: 0.75rem;   /* 12px */
    right: 0.75rem; /* 12px */

    /* text-slate-400 */
    color: #94a3b8;

    /* Reset button defaults */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px; /* Makes it easier to click */
    
    display: flex;
    align-items: center;
    justify-content: center;

    top: 4px;   /* Move it closer to the top edge */
    right: 8px; /* Standard spacing from the right */

    /* Smooth transition for the hover effect */
    transition: color 0.2s ease;
}

/* hover:text-slate-600 */
.close-btn-safety:hover {
    color: #475569;
}

/* h-4 w-4 (for the SVG inside) */
.close-btn-safety svg {
    width: 1rem;  /* 16px */
    height: 1rem; /* 16px */
}

.popover-content {
    color: #475569; /*slate 600 */
    font-size: 0.8rem;
}

.popover-footer {
    color: #475569; /* slate 400 — lighter than content */
    font-size: 0.72rem;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}


/* This class "wakes up" the popover */
.popover-info.is-visible {
    display: flex;
}


/* safety popover end */


/* safety table severity-class start */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative; 
    padding: 2px 8px; 
    font-size: 0.9rem; 
    cursor: default;
    border-radius: 20px;
    margin: 2px;
    white-space: normal;
    border: 1px solid var(--chip-border);
    color: var(--text);
    overflow-wrap: break-word;   /* ← only breaks if truly necessary */
  }

  .row-chips-peek .chip {
    white-space: nowrap;    /* keep peek chips on one line */
    max-width: 120px;       /* adjust as needed */
}

.chip .pos {
    white-space: nowrap;    /* keep #37 from wrapping alone */
    opacity: 0.45;
}

.has-tip {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: currentColor;
    cursor: help;
}
.s0 {
    background: transparent; padding: 0;}
.s1 { background: var(--low); color: #92640a; }  /* soft yellow */
.s2 { background: var(--moderate); color: #9a4e1a; }  /* soft orange */
.s3 { background: var(--high); color: #9b2020; }  /* soft red */
.tip { 
    display: none; 
    position: absolute;
    top: calc(100% + 6px);  /* changed from bottom to top */
    left: 50%; 
    transform: translateX(-50%); 
    background: #2C2C2A; 
    color: #F1EFE8; 
    padding: 6px 10px; 
    border-radius: 6px; 
    font-size: 12px; 
    white-space: nowrap; 
    z-index: 999; 
    pointer-events: none; }
    
.tip::after { 
    content: ''; 
    position: absolute; 
    bottom: 100%; 
    left: 50%; 
    transform: translateX(-50%); 
    border: 5px solid transparent; 
    border-bottom-color: #2C2C2A; }

.tip-floating {
    display: none;
    position: fixed;
    background: #2C2C2A;
    color: #F1EFE8;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 220px;
    white-space: normal;
    z-index: 9999;
    pointer-events: none;
}

.tip-floating::after {
    content: '';
    position: absolute;
    top: 100%;
    left: calc(50% + var(--arrow-offset, 0px));
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2C2C2A;
}
/* safety table severity-class end */

/* safety consideration tab content for desktop start */

.skintable-wrapper {
    margin-top: 0.6rem;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #E2E8F0;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    text-align: left;
}

/* safety consideration tab content for desktop end */


/* mobile table start */

.table-container { /*size of the accordion */
    max-width: var(--list-max-width);
    margin: 1rem 0;
    display: block;
}

/* The "Row" container */
.row-item {
    background: white;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    margin-bottom: 0.5rem;
    
}


/* Column 1: The Always Visible Header */
.row-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.row-header:active {
    background-color: #f1f5f9;
}

.row-header .title-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.95rem;
}

.chevron {
    transition: transform 0.3s;
    color: #94a3b8;
}

/* Hidden Content Logic */
.details-check {
    display: none;
}

.details-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 1rem; /* Horizontal padding stays even when closed */
    transition: max-height 0.3s ease, padding 0.3s ease; /* Transition BOTH */
    background-color: #fafafa;
    border-top: 0 solid var(--border);
    
    
}
.details-content > .details-content-inner {
    min-height: 0;
}

/* When checkbox is checked, expand and rotate chevron */
.details-check:checked ~ .details-content {
    max-height: 500px;
    border-top-width: 1px;
    padding: 1rem; /* Vertical padding animates in */
}


/* Inner Column Styling */
.meta-group {
    margin-bottom: 0.75rem;
}

.label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

/* Column 2: Pills */
.pill {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 10px;
    border-radius: 99px;
    
    font-weight: 500;
    margin-right: 5px;
}

/* Column 3 & 4 */
.class-text { font-size: 1rem; font-weight: 500; }
.note-text { font-size: 1rem; color: #475569; line-height: 1.4; }

/* mobile table end */

/* tabs start */

.tab-wrapper { max-width: 500px; }
.tab-buttons { display: flex; column-gap: 1.5rem; margin-top: 2rem; font-size: 1rem;
            
}

.tab-btn { 
    padding-bottom: 10px; cursor: pointer; border: none; background: none; 
    border-bottom: 3px solid transparent; transition: 0.3s;
    touch-action: manipulation; /* Removes the 300ms delay on tap */
    font-size: 1rem;
    
}

/* The "Active" visual state */
.tab-btn.active { border-bottom: 3px solid #003595; color: #003595; 
}

.tab-content {  
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    padding-top: 1.4rem;
    padding-bottom: 1rem;
    margin-top: -1px; 
    display: none;
    border: none;
    border-top: 1px solid #CBD5E1; 
    
    
}

.tab-content.active { display: block; }

/* tabs end */


/* product carousel start */

.carousel-wrapper {
    align-items: center;
    margin: auto;
}

/* This is stronger than just .carousel-title */


.navbar-carousel {
    
    display: flex;
    align-items: center;
    margin-top: 1.5rem;
    margin-left: auto;   /* These two lines force */
    margin-right: auto;  /* horizontal centering */
    gap: 0.8rem;
    justify-content: right; /* ← THIS */
    color: #334155; /* salte 700 */
    margin-bottom: 1.25rem;
}

.page-numbers {
    display: flex;
    gap: 0.9rem;
    font-weight: 700;
    color: #94A3B8; /* slate 400 */
    font-size: 0.8rem;
    line-height: 0.1rem;
    
}

.toscroll {
    color: #94A3B8; 
    
}

.toscroll:hover {
    color: black;
}

.see-all {
    letter-spacing: -0.05em;     /* tracking-tighter */
    color: #64748B;              /* default slate-500 (assumed) */
    transition: color 0.15s ease; /* transition-colors */
    cursor: pointer;
    margin-bottom: 10px;
    font-size: 1rem;
}

/* direct style transfer */

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.carousel-track {
    display: grid;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-top: 0.95rem;
    /* MOBILE: 2 rows. We use 50% width columns. 
        The 'auto-flow: row' makes products 1 & 2 stay on top, 3 & 4 on bottom. */
    grid-template-rows: repeat(2, auto);
    grid-auto-columns: calc(50% - 8px);
    grid-auto-flow: column; 
}

@media (min-width: 1024px) {
    .carousel-track {
        /* DESKTOP: 1 row, 4 columns per view */
        grid-template-rows: 1fr;
        grid-auto-columns: calc(25% - 12px);
    }
}

.product-item {
    scroll-snap-align: start;
    background: transparent;
    padding: 0.5em 0.5em 0.5em 0.5em;
    text-align: center;
}

.product-item:hover {
    cursor: pointer;
    text-decoration: underline;
}

.page-num { cursor: pointer; transition: color 0.3s; font-size: 1rem; }
.page-num.active { color: black; 
    padding-bottom: 0.5rem; border-bottom: 2px solid black; }

.carousel-title {
    margin-bottom: 1.25rem;
    padding-top: 1.5rem;
}

.next-arrow {
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transform: translateY(-5px); /* Moves it up exactly 2 pixels */
    margin-left: 3px;
    
}

.next-arrow svg {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
}

.see-all {
    letter-spacing: -0.05em;     /* tracking-tighter */
    color: #64748B;              /* default slate-500 (assumed) */
    transition: color 0.15s ease; /* transition-colors */
    cursor: pointer;
    margin-bottom: 10px;
    
   
   
}

.vertical-divider {
    height: 16px;            /* h-4 */
    width: 1px;             /* w-[1px] */
    background-color: #e2e8f0; /* bg-slate-200 */
    display: inline-block;    /* Allows it to sit next to text/icons */
    margin-bottom: 10px;
}

.product-brand {
    font-weight: 600;
    color: #003595;
}

.product-name {
    color: #475569;  /* slate 600 */
}

.avg-price {
    font-size: 1.06em;
}


/* product carousel end */


/* safety accordion */


.signals-container {
    display: flex;
    column-gap: 2px;
    font-size: 0.95rem;
}

.arrow-accordion {
    display: inline-block; /* Essential for transforms to work on some elements */
    transition: transform 0.3s ease;
    transform-origin: center;
}

#row1:checked + .row-header .arrow-accordion {
    transform: rotate(180deg);
}

.signals-title, .signals-count {
    color: #0F172A; /* slate 900 */
}

.sg-list {
  counter-reset: ingredientsg-counter; /* Initialize the counter */
  display: flex;
  flex-wrap: wrap;
 
}



.ingredientsg {
    counter-increment: ingredientsg-counter; /* Increment by 1 */
    content: " (#" counter(ingredientsg-counter) ")"; /* Display the number */
    
    color: #94a3b8; /* slate-400 - make it subtle */
    font-weight: 500;
    margin-left: 2px;
}

/* Specific style for the (#1) part */
.sg-list small {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748b; /* slate-500 */
    vertical-align: super; /* Makes it look like a footnote */
}

/* style footer start */

footer {
    font-size: clamp(0.8rem, 1vw + 0.4rem, 0.8125rem);
    color: #475569;        /* text-slate-600 */
    
    box-sizing: border-box;  /* ← makes padding/margin not add extra width */
}

.footer-container { display: flex;             /* Change from inline-block to flex */
    flex-direction: row;      /* Items sit side-by-side */
    justify-content: space-between; /* Pushes Terms to left, Brand to right */
    align-items: center;  /* Aligns items to the top (better for wrapping text) */
  
    width: 100%;
    padding: 1rem 0;
    border-top: 1px solid rgba(22,163,74,0.3);
    gap: 2rem;                /* Space between text and brand box */
     /* Keeps everything pinned to the right edge */
    margin-top: auto;}



@media (max-width: 834px) { /* mobile */
    
   
    .footer-container {
    display: block;
    margin-top: auto;
    
}


    .brand-name {
    row-gap: 2rem;
    }
}

.tn-text {
    /* 1. This allows the text to shrink as much as needed */
    flex: 1 1 auto; 
    /* 2. Standard comfortable reading width we discussed */
    max-width: 600px; 
    /* 3. Prevents text from disappearing entirely */
    min-width: 200px;
}

.tos {
    text-decoration: underline;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.tos:hover, .feedback:hover {
    color: #0f172a; /* hover:text-slate-900 */
}

.brand-footer-container {
    margin-top: 0.25rem;
    column-gap: 1.5rem;  
    align-items: flex-end; /* Keeps everything pinned to the right edge */
}

.feedback {
    transition-property: color;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-name {
    white-space: nowrap; /* Forces everything to stay on one line */
    margin-top: 0.25rem;
}

/* style footer end */