/* 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;
    --footer-font-size: clamp(0.8rem, 1vw + 0.4rem, 0.8125rem);
    --notice-font-size: 0.9rem;
    --footer-color: #475569; /* slate 600 */
    --general-border-color: #CBD5E1; /* slate 200 */
    --signature-color: #003595;
    --signature-pale-blue: #EEF2FF;
    --rare-color: #999999;
    --show-less-color: #94A3B8;

    --table-border: 1px solid #e5e7eb;
    --table-line: 0.5px solid #eee;

    /* --body-color: #5f5e5a; */
    --text-primary-color:   #5b616b;   
    --text-secondary-color: #A3A3A3;   
    --text-muted-color:     #8d8d8d;   
    --card-count-color: #94A3B8;
    --card-count-bg: #F1F5F9;

    --muted-ing-name: #0A0A0ABF; /* 0.75 opacity body-color */
    --muted-bg: #f5f7f9;
    --unselect-btn: #f4f6f9;
    
    --ing-name-font-size: 0.97rem;
    --pos-font-opacity: 0.45;

    --local-text-lg:   1.2rem;    /* section titles */
    --local-text-md:   1.06rem;   /* section subtitles */
    --local-text-base: 0.97rem;   /* ing.name — your current size */
    --local-text-sm:   0.9rem;   /* secondary notes, advice, sub text */
    --local-text-xs:   0.8rem;   /* footnotes, positions, scores */
    
    --footnote-text: 0.78rem;
  }

/* --- 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(1rem, 5vw, 1.03rem);
    font-weight: 500;
}

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

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-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;
    padding: 0 1.5rem;
}

.nav-right-container {
    display: flex;
    
    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;
   
}

/* 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;
}

input#sc_product_title {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 1rem;
    width: 100%;
}

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

.product-title:invalid {
    box-shadow: none;
    background-color: #ffffff;
}

.product-title:focus, input#sc_product_title:hover, input#sc_product_title:focus  { 
    border-color: #cbd5e1; 
    outline: none;
}

.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: 200px;
    max-height: 400px;  /* Stops growing here */

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

.drawer-input:hover, .drawer-input:focus {
    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, input#sc_product_title::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: 768px) {

        .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*/

.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 */
    padding-top: 1.5rem;
}

/* skin concern tab start */

.concern-btn {
    border: 1px solid var(--unselect-btn);
    color: #475569; 
    background: var(--unselect-btn);
    padding: 7px 16px 8px 16px;
    cursor: pointer;
    border-radius: 20px;
    transition: 0.3s;
    margin-top: 0.5rem;
}

.concern-btn.active {
    border: none;
    color: #003595;
    font-weight: 500;
    background: var(--signature-pale-blue);
    border: 1px solid var(--signature-pale-blue);

    /* Add these two lines */
    pointer-events: none; 
    cursor: default;
}

.concern-selection {
    /* font-size: clamp(0.875rem, 2vw + 1rem, 1rem);; */
    color: #475569;
    margin-bottom: 0.75rem;
    margin-top: 2rem;
}

/* AJAX error */

.si-notice {
    position: relative;                 /* fixed */
    display: inline-flex;
    margin-top: 2rem;
    border-radius: 0.375rem;         /* rounded-md → 6px */
    border: 1px solid #e2e8f0;       /* border + border-slate-200 */
    background-color: #f8fafc;      /* bg-slate-50 */
    padding: 1rem;            /* py-2 (8px) px-4 (16px) */
    color: #475569;                  /* text-slate-600 */
    line-height: 1.25rem;
    width: fit-content;
}
.si-notice span {
    padding-right: 0.75rem;
}
.si-x-btn {
    margin-left: 0.25rem;        /* ml-2 → 8px */
    color: #94a3b8;             /* text-slate-400 */
    font-size: 1.125rem;        /* text-lg → 18px */
    
    font-weight: 700;  
    
    top: 0.5rem;
    right: 0.5rem;         /* font-bold */
}

/* Hover state */
.si-x-btn:hover {
    color: #475569;             /* hover:text-slate-600 */
}

/* Focus state */
.si-x-btn:focus {
    outline: none;              /* focus:outline-none */
}

/* style footer start */

footer {
    font-size: var(--footer-font-size);
    color: var(--footer-color);        /* 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 var(--general-border-color);
    gap: 2rem;                /* Space between text and brand box */
     /* Keeps everything pinned to the right edge */
    margin-top: auto;}



@media (max-width: 768px) { /* 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 */