html, body {
    font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--mud-palette-background, #ffffff); /* Ensure solid backdrop (prevents iOS bottom gap flash) */
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2Lj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: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}
.mud-input.mud-input-filled.mud-input-adorned-start, .mud-input > input.mud-input-root.mud-input-root-filled.mud-input-root-adorned-end {
    border-radius: 1.5em;
    background-color: #dee9fb !important;
    
    cursor: pointer;

}

.mud-elevation-4 {
    box-shadow: none !important
}


.mud-container {
    margin-top: 2em;
    /* Reduced bottom margin now that footer is no longer absolutely positioned */
    margin-bottom: 2.5rem;
}


.mud-input.mud-input-filled.mud-input-adorned-start, .mud-input > input.mud-input-root.mud-input-root-filled.mud-input-root-adorned-end {
    border-radius: 1.5em;
    background-color: #dee9fb;
    color: #091733;
}

div.mud-input-slot.mud-input-root.mud-input-root-filled.mud-input-root-adorned-end {
    border-radius: 3em;
    background-color: #164d7f;
    padding: 20px 20px;
    color: #fff !important;
    font-size: 20px;
    line-height: 22px;
    min-width: 400px;
    font-weight: 400;
    text-align: center;
}



.mud-input > input.mud-input-root, div.mud-input-slot.mud-input-root {
    /*color: #091733 !important;*/
}

.select-color-white {
    background-color: #fff !important;
    border-radius: 1rem;
    border: 0 !important;
}

.mud-select-input {
    border: none !important;

}

.back-button {
    border-color: #3B81F9 !important;
}

.bg-dropdown .mud-input.mud-input-filled {
    transition: none !important;
    background-color: transparent !important;
}

.bg-dropdown {
    background-color: #164d7f !important;
    border-radius: 1.5em;
    color: #fff;
}

.bg-dropdown .mud-icon-root.mud-svg-icon {
    fill: #fff !important;
    font-size: 20px;
    margin-top: 1px;
}

.mud-progress-linear.mud-progress-linear-color-secondary:not(.mud-progress-linear-buffer)::before
{
    background-color: #fff !important;
}

.mud-input.mud-input-filled.mud-input-underline::before, .mud-input.mud-input-underline::before, .mud-list-item-clickable {
    transition: none !important;
    border-bottom: none !important;
}

input {
    border: none !important;
}
.basic-autocomplete .mud-input-control-input-container .mud-input .mud-input-adornment {
    margin-top: 5px;
}
.basic-autocomplete .mud-input-control-input-container .mud-input .mud-input-root {
    padding-top: 0.75rem !important;
}

.mud-dialog-actions button, .mud-dialog-actions button:hover, .mud-dialog-actions button:focus {
    background-color: #164d7f;
    color: #fff;
    width: 80%;
    margin: 0 auto;
}

.mud-popover {
    background-color: #dee9fb !important;
}

/* .status-action-button { } removed empty rule */

.mud-list-item-text p {
    color: #091733;
}

/*.mud-list-item-clickable:hover {
    background-color: #fff !important;
}*/

.mud-list-item-clickable:hover .mud-list-item-text p {
    color: #3b81f9;
}

.mud-selected-item.mud-primary-hover {
    background-color: #fff !important;
    color: #3b81f9 !important;
}

.mud-selected-item p {
    color: #3b81f9 !important;
}

.drugcards {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    padding-left: 1.85em;
    margin-bottom: 3rem;
}

.drugcards > div .drugcard {
    margin: 1em;
    padding: 1em;
    border-radius: .5em;
    border: solid 2px rgb(22, 77, 127);
    color: #2c2e2e;
    background-color: #fff;
    min-height: 16em;
    cursor: pointer
}

.drugcards > div .drugcard:hover {
    border: 2px solid #3b81f9;
}

.drugcard div p {
    font-size: 1em;
}

.drugcard div p span {
    color: #8c8c8e
}

.drugcard > .mud-card-content {
    min-width: 170px;
    padding: .5em;
    word-break: break-word;
}

/*.mud-card {
    margin: 1em;
    padding: 1em;
    border-radius: .5em;
    border: solid 2px #d6d6d8;
    min-height: 30em;
}*/

.results-card {
    min-height: auto !important;
    cursor: default !important;
}

.results-card-text {
    color: #091733;
    text-align: center;
}

.card-variants {
    background-color: #dee9fb !important;
    border-radius: 1.5em !important;
    border: none;
}
.card-variants.results-card,
.card-variants.results-card:hover,
.card-variants.results-card:focus,
.card-variants.results-card:active {
    box-shadow: none !important;
    outline: none !important;
    border: none !important;
}

/* Ensure expansion content uses theme text color (avoid white bleed), but do not override button labels */
.card-variants.results-card .mud-expand-panel-content p,
.card-variants.results-card .mud-expand-panel-content .mud-typography {
    color: var(--mud-palette-text-primary) !important;
}
/* Preserve readable contrast for filled buttons inside results cards */
.card-variants.results-card .mud-button-root.mud-button-filled-primary .mud-button-label,
.card-variants.results-card .mud-button-root.mud-button-filled-primary .mud-button-label .mud-typography {
    color: var(--mud-palette-on-primary) !important;
}
.card-variants.results-card .mud-button-root.mud-button-filled-secondary .mud-button-label,
.card-variants.results-card .mud-button-root.mud-button-filled-secondary .mud-button-label .mud-typography {
    color: var(--mud-palette-on-secondary) !important;
}

    .card-variants .mud-card-content {
        width: 100% !important;
        min-width: 168px;
        padding: .6em;
    }

.mud-grid-item-xs-12 {
    display: flex;
    align-items: stretch
}

.mud-radio > .mud-radio-content {
    color: #091733 !important
}

.mud-divider-fullwidth.text-black {
    border-color: #fff;
    border-width: 2px;
}

.mud-radio {
    display: flex !important;
}



.mud-list-item.results-panel, .mud-list-item.results-panel-active {
    border-radius: 2rem !important
}

.results-panel {
    background-color: #091733;
    box-shadow: none !important;
}

.results-panel-active {
    background-color: #091733 !important;
}

.mud-list-item.results-panel-active button {
    color: rgb(9, 23, 51) !important;
}

/* Limit white text to dark results-panel variant only, not all expansion content */
.results-panel .mud-expand-panel-content p {
    color: #fff !important;
}

.mud-button-label .mud-icon-root.mud-svg-icon {
    margin-right: .65em;
}

.best-price {
    max-width: 14em;
    color: #091733;
    top: 1.25rem;
    z-index: 2;
    font-weight: 700 !important;
    height: 3em;
}

p.w {
    color: #fff !important;
}

h6.card-price {
    font-size: 1.85em;
    font-weight: 600
}

.mud-disabled > .mud-expand-panel-header {
    color: #fff !important
}

.mud-dialog-width-sm {
    max-width: 640px !important;
}

.terms {
    margin: 0 1em;
}

ol.main {
    padding: 0 2.5em;
}

ol.main ul {
    padding-left: 1.85em;
}



.delete-button {
    margin-top: 20px;
    top: 5%;
    right: 2%;
}

.status-action-button {
    margin-top: 20px;
    top: 8%;
    left: 25%;
}

/**keeping link just in case*/
footer div a:link, footer div a:visited, footer div a:active {
    color: #fff !important;
    text-decoration: none;
}

footer div a:hover {
    text-decoration: underline;
}
.alternate-search {
    text-decoration: underline;
    font-style: italic;
    display: block;
    text-align: center;
}

.alternate-search:hover {
    background-color: var(--mud-palette-primary);
}

.ai-search-input {
    top: auto;
    bottom: 120px;
    
    width: 100%;
    z-index: 10;
}

.layout-overflow {
    overflow-y:scroll;
    padding-bottom: 3rem;
    
}
.ai-search-input .flex-column .rounded-pill .mud-input-control-input-container .mud-input .mud-input-slot {
    padding-top: 0.55rem;
}

.chat-message-container {
    margin-bottom: 2rem;
    /* Added top padding to prevent first chat message from appearing visually clipped under sticky or initial scroll position */
    padding-top: 0.5rem;
}

.microphone-basic {
    flex-direction: row !important;


    align-self: end;
    margin-top: -2.5rem;

}

@media screen and (max-width: 59.938em) {
        .mud-card {
        margin: 1em auto;
        min-height: auto;
    }

    .best-price {
        top: 2rem;
    }

    h6.card-price {
        font-size: 1.5em;
        font-weight: 500
    }

    .mud-card-content {
        padding: .6em !important;
    }

    .mud-radio {
        display: inline-flex !important;
    }
    .chat-message-container {
        padding-bottom:0;
        /* Mirror base top padding for mobile to maintain consistent vertical spacing */
        padding-top: 0.5rem;
    }

/*    .ai-search-input {
        z-index: 10;
        top: auto;
        bottom: 16rem;
        height: 1rem;
        position: fixed;
        width: 100%;
    }*/

    .mud-container {
        margin-top: 2em;
        
    }

/*    .ai-search-input .flex-column .rounded-pill .mud-input-control-input-container .mud-input .mud-input-slot {
        padding-top: 0.85rem;
    }*/
    footer div {
        max-width: 1280px;
        margin: 0 auto;
        font-size: 0.5rem;
    }
    .layout-overflow {
        padding-bottom: 0;
    }

    div.mud-input-slot.mud-input-root.mud-input-root-filled.mud-input-root-adorned-end {
        border-radius: 3em;
        background-color: #164d7f;
        padding: 20px 20px;
        color: #fff !important;
        font-size: 20px;
        line-height: 22px;
        min-width: 325px;
        font-weight: 400;
        text-align: center;
    }


    /* .chat-message-container div { } removed empty rule */

    .microphone-basic {
        display: none;
    }
}
/* Footer now participates in normal document flow (no absolute positioning) */
footer {
    padding: .85em;
    text-align: center;
    margin: 0 auto;
    width: 100%;
    flex-shrink: 0; /* if inside a flex column layout */
    /* Provide safe-area support on modern mobile devices */
    padding-bottom: calc(.85em + env(safe-area-inset-bottom, 0));
}

/*.footer-absolute {
    position: absolute !important;
}*/


/* `footer-relative` kept for backward compatibility; no special positioning needed anymore */
.footer-relative {
    position: initial !important;
    width: 100%;
}

/* Optional sticky variant if re-enabled in specific contexts */
.footer-sticky, .footer--sticky {
    position: sticky !important;
    bottom: 0;
    width: 100% !important;
    z-index: 20;
}

.container-full {
    /* Allow vertical expansion for dynamic iOS viewport; only hide horizontal overflow */
    overflow-x: hidden;
}

/* Ensure main home root stack expands to viewport height; use dynamic viewport units when supported */
.home-root {
    min-height: 100vh; /* fallback for browsers without dynamic viewport units */
}
@supports (height: 100dvh) {
    .home-root { min-height: 100dvh; }
}

/* Sticky Start New Search button (global) */
.ai-start-button-wrap {
    position: sticky;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    z-index: 10;
}

.ai-start-button {
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
@media screen and (max-width: 35em) {
    /* Mobile: footer already flows naturally; retain AI search input overlay */
    .ai-search-input {
        top: auto;
        bottom: 0;
        height: 8rem;
        left: 0;
        position: fixed;
        width: 100%;
        z-index: 2;
    }
    .container-full { height: 100%; }
}

/*640 - no further */
@media screen and (min-width: 35em) {

/*    footer {
        position: absolute !important;
        bottom: 0;
        left: 0;
        padding: .85em;
        width: 100%;
        color: #fff;
        text-align: center;
        z-index: 1;
    }

    .ai-search-input {
        top: auto;
        bottom: 0;
        height: 12rem;
        position: fixed;
        width: 100%;
        z-index: 2;
    }*/

    .ai-search-input {
        max-width: 100%;

    }

    h6.card-price {
        margin-top: 5px;
        font-size: 0.95em;
        font-weight: 600
    }

    .status-action-button {
        left: 15%;
    }

    .mud-container {
        margin-top: 2em;

    }

    .chat-message-container div {
        scroll-margin-top: 2rem;
    }
}

/* Keyboard floating class (transform-based lift only; fixed positioning reverted) */
.kb-floating {
    /* Position properties removed to revert to original flow layout.  */
    /* The JS will apply translateY(-height) on the inner element; no fixed offset needed. */
    z-index: 2200; /* Keep elevated above main content but below modals */
    width: 100% !important;
}

/* When keyboard is lifting the footer, compress vertical spacing inside the pill to reduce visual gap */
.kb-floating .rounded-pill {
    width: 100% !important;
}
.kb-sticky-footer-spacer {
    /*height: 3.5rem;  Approximate height of footer + safe area inset */
    position: sticky !important;
    bottom: max(0rem, env(keyboard-inset-height, 0rem));
}
/* Simple keyboard scroll lock overlay (keyboard.v3 integration) */
#kb-lock-overlay {
    cursor: default;
}
/* Reserved class for future styling if needed; intentionally left without properties */
/* body.kb-scroll-locked-simple { } */
/* Keyboard v4 overlay approach - blocks all background interaction when keyboard is open */
body.kb-overlay-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

#kb-scroll-block-overlay {
    /* Inline styles applied by JS, but define here for specificity if needed */
    touch-action: none !important;
    -webkit-user-select: none;
    user-select: none;
}

/* Optional: dim background slightly to show overlay is active (debugging) */
body.kb-overlay-active.kb-overlay-debug #kb-scroll-block-overlay {
    background: rgba(255, 0, 0, 0.1) !important;
}

/* Scroll lock body state (applied while virtual keyboard is open & kblock=1) */
body.kb-scroll-locked,
html.kb-scroll-locked {
    overflow: hidden !important; /* Prevent background scroll */
    overscroll-behavior: none; /* Avoid rubber banding on some browsers */
    touch-action: none; /* Suppress panning gestures */
}

/* Ensure body stays fixed with proper dimensions when locked */
body.kb-scroll-locked {
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Internal scrollable region allowed while lock is active */
.kb-scroll-locked .kb-internal-scroll {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y; /* Allow vertical pan only inside this container */
}

/* If main layout container is independently scrollable, suppress its scrolling while locked */
.kb-scroll-locked-container {
    overflow: hidden !important;
    touch-action: none !important;
}

/* Optional: smoothly limit overscroll if suggestion list shorter */
.kb-internal-scroll {
    overflow-y: auto;
    max-height: 40vh; /* Will still be adjusted by JS if needed later */
}
