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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.hidden {
    display: none !important;
}

/* ───────────────────────────────────────────────────────────────────────────
   FLAVORx brand theme (palette imported from the legacy modern.less / login.less)
     orange  #ff8200  primary / accents / active
     teal    #45a6b9  body background base
     gray    #93919a  secondary buttons / footer / borders
     red     #cb453a  hover / login background
   ─────────────────────────────────────────────────────────────────────────── */
:root {
    --fxf-orange: #ff8200;
    --fxf-orange-dark: #e27400;
    --fxf-teal: #45a6b9;
    --fxf-gray: #93919a;
    --fxf-red: #cb453a;
    --fxf-text: #333;
    --fxf-input-focus: rgba(250, 250, 210, 1);

    /* Map Bootstrap's primary onto FLAVORx orange so all primary UI is on-brand. */
    --bs-primary: #ff8200;
    --bs-primary-rgb: 255, 130, 0;
    --bs-link-color: #cb453a;
    --bs-link-color-rgb: 203, 69, 58;
    --bs-link-hover-color: #ff8200;
}

/* Tiled FLAVORx background over the teal base, mirroring the legacy app body. */
body {
    background: var(--fxf-teal) url('images/bgblue.png') fixed;
    color: var(--fxf-text);
    font-family: "Segoe UI", Verdana, Helvetica, Arial, sans-serif;
}

/* Primary buttons / badges → FLAVORx orange, with the legacy red hover. */
.btn-primary {
    --bs-btn-bg: var(--fxf-orange);
    --bs-btn-border-color: var(--fxf-orange);
    --bs-btn-hover-bg: var(--fxf-red);
    --bs-btn-hover-border-color: var(--fxf-red);
    --bs-btn-active-bg: var(--fxf-red);
    --bs-btn-active-border-color: var(--fxf-red);
    --bs-btn-disabled-bg: var(--fxf-orange-dark);
    --bs-btn-disabled-border-color: var(--fxf-orange-dark);
    font-weight: 700;
    letter-spacing: .3px;
}

.text-primary { color: var(--fxf-orange) !important; }
.bg-primary { background-color: var(--fxf-orange) !important; }

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--fxf-orange);
}

.progress-bar { background-color: var(--fxf-orange); }

input:focus, textarea:focus, select:focus, .form-control:focus, .form-select:focus {
    border-color: var(--fxf-orange) !important;
    box-shadow: 0 0 0 .15rem rgba(255, 130, 0, .25) !important;
}

/* Inputs get the pale-yellow focus tint from the legacy theme. */
.form-control:focus, .form-select:focus { background-color: var(--fxf-input-focus); }

/* ── App shell: top bar + (main | sidebar) + footer ──────────────────────── */
.fxf-shell { min-height: 100vh; display: flex; flex-direction: column; }

.fxf-topbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    background-color: #fff;
    border-bottom: 3px solid var(--fxf-orange);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
    padding: .5rem 1.25rem;
}
.fxf-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.fxf-brand img { height: 40px; }
.fxf-brand-title { color: #555; font-size: 1.5rem; font-weight: 600; }
.fxf-topbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.fxf-account { color: var(--fxf-red); font-weight: 700; }
.fxf-cuslogo { max-height: 36px; max-width: 180px; }
.fxf-logout {
    background: var(--fxf-orange); color: #fff; border: none; border-radius: 4px;
    padding: .35rem .6rem; font-weight: 700;
}
.fxf-logout:hover { background: var(--fxf-red); color: #fff; }

/* Body splits into the flexible main column and the fixed white sidebar. */
.fxf-body { flex: 1 0 auto; display: flex; align-items: stretch; }
.fxf-main { flex: 1 1 auto; min-width: 0; padding: 1.5rem 2rem; }
.fxf-sidebar {
    flex: 0 0 320px;
    background: #fff;
    border-left: 1px solid #e3e3e3;
    padding: 1.25rem 1.25rem 2rem;
}
.fxf-side-header {
    text-transform: uppercase;
    font-size: 1.05rem;
    font-weight: 700;
    color: #555;
    letter-spacing: .5px;
    margin: 1.25rem 0 .75rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid #eee;
}
.fxf-side-header:first-child { margin-top: 0; }
.fxf-whatsnew { display: flex; flex-direction: column; gap: .75rem; margin-bottom: .5rem; }
.fxf-ad { max-width: 100%; height: auto; display: block; }
.fxf-quicklinks { list-style: none; padding: 0; margin: 0; }
.fxf-quicklinks li { border-bottom: 1px solid #f0f0f0; }
.fxf-quicklinks a {
    display: flex; align-items: center; gap: .5rem;
    color: #444; text-decoration: none; font-weight: 500; padding: .55rem .25rem;
}
.fxf-quicklinks a:hover { color: var(--fxf-red); }
.fxf-quicklinks a:hover .fxf-link-icon { color: var(--fxf-red); }
.fxf-link-icon { width: 1.25rem; text-align: center; color: var(--fxf-orange); }

@media (max-width: 991px) {
    .fxf-body { flex-direction: column; }
    .fxf-sidebar { flex-basis: auto; border-left: none; border-top: 1px solid #e3e3e3; }
}

.fxf-footer { background-color: var(--fxf-gray); color: #fff; padding: 14px 0; }
.fxf-footer a { color: #fff; }
.fxf-footer-inner {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: .5rem; padding: 0 1.5rem;
}

/* Legacy flavor-preference key colors (recommended / acceptable / do-not-use). */
.pref2 { color: green; font-weight: 700; }
.pref1 { color: #585858; font-weight: 600; }
.pref0 { color: var(--fxf-red); text-decoration: line-through; }

/* Recipe table title rows use the legacy orange header. */
.recipe-print thead, table.fxf-table thead { background-color: var(--fxf-orange); color: #fff; }

/* ── Login ───────────────────────────────────────────────────────────────── */
/* Matches the deployed legacy login: the tiled bgblue pattern over teal (the
   brick-red in login.less was overridden in production), white wordmark, and the
   form sitting directly on the background — no card. */
.fxf-login-bg {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--fxf-teal) url('images/bgblue.png') fixed;
}

.fxf-login-main {
    flex: 1 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 1rem 2rem;
}

.fxf-login-panel {
    width: 100%;
    max-width: 760px;
    text-align: center;
    color: #fff;
}

.fxf-login-logo { max-width: 360px; width: 70%; }

.fxf-login-panel h1 {
    color: #fff;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.25rem);
    margin: .25rem 0 1rem;
}

.fxf-login-panel .lead { color: #fff; font-size: 1.1rem; }
.fxf-login-panel a { color: #fff; font-weight: 700; text-decoration: underline; }

.fxf-login-form { max-width: 560px; margin: 0 auto; }
.fxf-login-form label { color: #fff; font-weight: 300; font-size: 1rem; text-align: left; display: block; }
.fxf-login-form .form-control { padding: .6rem .9rem; }

/* Full-width orange LOGIN button with dark uppercase label, like the deployed site. */
.fxf-login-btn {
    width: 100%;
    background: var(--fxf-orange);
    border: 1px solid var(--fxf-orange);
    color: #1a1a1a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .7rem;
}
.fxf-login-btn:hover { background: var(--fxf-red); border-color: var(--fxf-red); color: #fff; }

/* Pill toggle for account vs. staff, in a translucent panel so the active tab is obvious. */
.fxf-login-tabs-wrap {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 12px;
    padding: .35rem;
}
.fxf-login-tabs .nav-link { color: #eaf6f9; font-weight: 600; border-radius: 9px; }
.fxf-login-tabs .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .10); }
.fxf-login-tabs .nav-link.active {
    background: #fff;
    color: var(--fxf-teal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

/* Same translucent panel around the input area so the active form reads as one card. */
.fxf-login-content {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 12px;
    padding: 1.25rem;
}

/* Store-number autocomplete dropdown. */
.fxf-store-wrap { position: relative; }
.fxf-store-hint { color: rgba(255, 255, 255, .75); margin-top: .25rem; }
.fxf-store-suggest {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
    margin-top: 4px; background: #fff; border-radius: 8px; overflow: hidden;
    border: 1px solid #dcdce0; box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}
.fxf-store-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
    width: 100%; border: none; background: #fff; color: var(--fxf-text);
    padding: .55rem .85rem; text-align: left; cursor: pointer;
}
.fxf-store-item:hover, .fxf-store-item.active { background: var(--fxf-orange); color: #fff; }
.fxf-store-num { font-weight: 700; }
.fxf-store-loc { color: var(--fxf-gray); font-size: .85rem; }
.fxf-store-item:hover .fxf-store-loc, .fxf-store-item.active .fxf-store-loc { color: #fff; }

.fxf-login-footer {
    background: var(--fxf-gray);
    color: #fff;
    padding: 14px 24px;
}
.fxf-login-footer a { color: #fff; text-decoration: underline; font-weight: 700; }
.fxf-login-footer img { height: 30px; }

/* ── Branded error / not-found pages (robot, over the teal background) ─────── */
.fxf-error {
    margin: auto;
    text-align: center;
    color: #fff;
    padding: 4vh 1rem 5vh;
    max-width: 760px;
}
.fxf-error-logo { max-width: 340px; width: 70%; margin-bottom: 1.25rem; }
.fxf-error-title { color: #fff; font-weight: 800; font-size: clamp(2.5rem, 6vw, 4rem); margin: 0; }
.fxf-error-sub { color: #fff; font-size: clamp(1.2rem, 3vw, 2rem); margin-bottom: 1.25rem; }
.fxf-error-bot { width: 260px; max-width: 55%; height: auto; display: block; margin: .5rem auto 1.5rem; }
.fxf-error-help { color: #fff; font-weight: 700; margin-bottom: .4rem; }
.fxf-error-link { color: #fff; text-decoration: underline; }
.fxf-error-link:hover { color: #fff; }
.fxf-error-id { color: rgba(255, 255, 255, .7); font-size: .85rem; margin-top: 1.5rem; }
.fxf-error-id code { color: rgba(255, 255, 255, .85); }

/* ── Recipe output ───────────────────────────────────────────────────────── */
.recipe-header {
    white-space: pre-wrap;
    font-family: inherit;
    margin: 0;
}

.fxf-vet-banner img { max-height: 56px; }

/* Blazor circuit error toast — hidden by default; Blazor reveals it (inline
   display:block) only when an unhandled error actually occurs. */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── Recipe generator (full-width progressive flow) ──────────────────────── */
.fxf-gen { max-width: 100%; }

.fxf-gen-header {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .5px;
    color: #404040;
    border-bottom: 2px solid rgba(255, 255, 255, .7);
    padding-bottom: .5rem;
    margin: .5rem 0 1.25rem;
}

/* Field row: gray label pill · white input · gray clear button (legacy style). */
.fxf-field { display: flex; align-items: stretch; margin-bottom: .35rem; }
.fxf-field-label,
.fxf-field-toggle {
    background: var(--fxf-gray);
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    padding: .65rem 1rem;
    white-space: nowrap;
}
.fxf-field-label { min-width: 150px; }
.fxf-field-toggle { border: none; cursor: pointer; }
.fxf-field-toggle.active { background: var(--fxf-orange); }
.fxf-field-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid #cdcdcd;
    border-left: none; border-right: none;
    padding: .65rem 1rem;
    font-size: 1.05rem;
}
.fxf-field-input:disabled { background: #fff; color: #333; }
.fxf-field-clear {
    background: var(--fxf-gray);
    color: #fff; border: none; cursor: pointer;
    padding: .65rem 1.1rem;
}
.fxf-field-clear:hover { background: var(--fxf-red); color: #fff; }

/* Clickable list groups (search results, bottle sizes, flavors). */
.fxf-list { background: #fff; border: 1px solid #e2e2e2; margin-bottom: .9rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.fxf-list-item {
    display: block; width: 100%; text-align: left;
    background: #fff; border: none; border-bottom: 1px solid #eee;
    padding: .8rem 1.25rem; cursor: pointer; color: #444; font-size: 1.05rem;
}
.fxf-list-item:last-child { border-bottom: none; }
.fxf-list-item:hover { background: #f4fbfd; }
.fxf-list-item.selected { background: var(--fxf-orange); color: #fff; }
.fxf-drug-primary { display: block; font-weight: 600; }
.fxf-drug-secondary { display: block; font-size: .85rem; color: #888; }

/* Loading indicators (animated GIFs in /images) + no-result / catalog notices.
   Block (default): the square spinner for sections, tables and full-page waits.
   Inline: the flat dot strip sized to sit inside a button or a line of text. */
.fxf-loading { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 2rem; color: #666; }
.fxf-loading-img { height: 52px; width: auto; }
.fxf-loading-msg { color: #666; }
.fxf-loading-inline { display: inline-flex; padding: 0; gap: .4rem; vertical-align: middle; }
.fxf-loading-inline .fxf-loading-img { height: 1.1em; }
.fxf-loading-inline .fxf-loading-msg { color: inherit; }
.fxf-notice { color: #555; padding: 1rem 1.25rem; cursor: default; }

.fxf-flavor { text-decoration: underline; font-weight: 600; }
.fxf-flavor.pref2 { color: green; }
.fxf-flavor.pref1 { color: #585858; }
.fxf-flavor.pref0 { color: var(--fxf-red); text-decoration: line-through; }
.fxf-list-item.selected.fxf-flavor { color: #fff; }

.fxf-flavor-key {
    background: rgba(255, 255, 255, .35);
    padding: .5rem 1rem; margin-bottom: .35rem; border-radius: 4px;
}
.fxf-flavor-key span { margin-left: 1rem; }

.fxf-gen-actions { display: flex; gap: .75rem; margin: 1.1rem 0; }
.fxf-generate {
    background: var(--fxf-orange); color: #fff; font-weight: 700;
    text-transform: none; padding: .6rem 1.5rem; border: none;
}
.fxf-generate:hover { background: var(--fxf-red); color: #fff; }

/* Recipe output card (light panel over the teal background). */
.fxf-recipe {
    background: rgba(255, 255, 255, .82);
    border-radius: 10px; padding: 1.25rem 1.5rem; margin-top: 1.5rem;
}
.fxf-tip { background: #fff; border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: .75rem; }
.fxf-tip-title { color: var(--fxf-red); font-weight: 800; margin-bottom: .35rem; }
.fxf-tip ul { color: var(--fxf-red); font-weight: 700; }
.fxf-recipe-table { background: #fff; }
.fxf-recipe-table thead th { background: var(--fxf-orange); color: #fff; border: none; }
.fxf-recipe-table td { vertical-align: middle; }
.fxf-recipe-table tr.fxf-ing-removed td { color: var(--fxf-gray); }
.fxf-ing-btn { color: var(--fxf-gray); border: none; background: transparent; padding: .15rem .4rem; }
.fxf-ing-btn:hover { color: var(--fxf-red); }
.fxf-ing-removed .fxf-ing-btn:hover { color: var(--fxf-teal); }

/* Rich hover tooltip (replaces the small native title tooltip). */
.fxf-tip-wrap { position: relative; display: inline-block; }
.fxf-tooltip {
    position: absolute; right: 0; bottom: calc(100% + 10px); z-index: 20;
    width: 280px; max-width: 70vw; padding: .7rem .85rem;
    display: flex; gap: .6rem; align-items: flex-start; text-align: left;
    background: #fff; color: var(--fxf-text);
    border: 1px solid #e3e3e6; border-top: 3px solid var(--fxf-orange);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    font-size: .85rem; line-height: 1.35; font-weight: 400;
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    white-space: normal; pointer-events: none;
}
.fxf-tooltip strong { color: var(--fxf-orange); }
.fxf-tooltip-icon { color: var(--fxf-orange); font-size: 1.15rem; margin-top: .1rem; flex: 0 0 auto; }
/* Little pointer at the bottom-right, aimed at the button. */
.fxf-tooltip::after {
    content: ""; position: absolute; top: 100%; right: 12px;
    border: 7px solid transparent; border-top-color: #fff;
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .08));
}
.fxf-tip-wrap:hover .fxf-tooltip,
.fxf-tip-wrap:focus-within .fxf-tooltip {
    opacity: 1; visibility: visible; transform: translateY(0);
}

/* ── Veterinary builder: teal-labelled fields (mirrors the legacy vet.css look) ── */
.fxf-vet .accordion-button:not(.collapsed) { background: var(--fxf-teal); color: #fff; }
.fxf-vet .accordion-button:not(.collapsed)::after { filter: brightness(0) invert(1); }

/* A step whose prerequisites are unmet is disabled, and says what is still missing. */
.fxf-vet .accordion-button:disabled,
.fxf-vet .accordion-button:disabled:hover {
    background: var(--bs-secondary-bg, #f2f2f2);
    color: var(--bs-secondary-color, #6c757d);
    cursor: not-allowed;
    opacity: 1;                 /* the lock note carries the meaning, not a faded label */
}
.fxf-vet .accordion-button:disabled::after { opacity: .35; }
.fxf-step-lock {
    font-size: .8125rem;
    font-weight: 400;
    font-style: italic;
    white-space: nowrap;
    margin-left: .75rem;
}

.fxf-vet-field {
    display: flex; align-items: center; gap: 0; margin-bottom: .75rem;
}
.fxf-vet-field .fxf-vet-label {
    background: var(--fxf-teal); color: #fff; font-weight: 700;
    padding: .5rem .9rem; border-radius: 6px 0 0 6px; white-space: nowrap; align-self: stretch;
    display: flex; align-items: center; min-width: 9.5rem;
}
.fxf-vet-field > .form-control, .fxf-vet-field > .form-select { border-radius: 0; }
.fxf-vet-field > .form-control:last-child,
.fxf-vet-field > .form-select:last-child { border-radius: 0 6px 6px 0; }
.fxf-vet-field > .input-group-text { border-radius: 0 6px 6px 0; }
.fxf-vet-field > .btn { border-radius: 0 6px 6px 0; }
.fxf-vet-field.align-items-start .fxf-vet-label { align-self: flex-start; }
.fxf-wt { width: auto; max-width: 11rem; }
.well-pills { background: #f3f3f5; border-radius: 6px; padding: .75rem 1rem; }
.fxf-attr-table th { width: 14rem; color: var(--fxf-teal); font-weight: 600; }
.fxf-attr-table, .fxf-attr-table td, .fxf-attr-table th { border-color: #d7e3e6; }
.fxf-dose-unit { max-width: 12rem; flex: 0 0 auto; border-radius: 0 6px 6px 0 !important; }

/* Recipe sub-section panels. */
.fxf-panel { background: #fff; border: 1px solid #d7e3e6; }
.fxf-panel-title { color: var(--fxf-teal); font-weight: 700; margin-bottom: .5rem; }
.fxf-details { background: #fff; border: 1px solid #d7e3e6; border-radius: 6px; padding: .5rem .75rem; }
.fxf-details > summary { cursor: pointer; }

/* Save-to-LogBook optional step. */
.fxf-logbook { margin-top: 1.25rem; background: rgba(255, 255, 255, .92); border-radius: 10px; overflow: hidden; }
.fxf-logbook-head {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    background: var(--fxf-orange); color: #fff; font-weight: 700; font-size: 1.05rem;
    border: none; padding: .8rem 1.1rem; cursor: pointer;
}
.fxf-logbook-head:hover { filter: brightness(.96); }
.fxf-logbook-body { padding: 1.1rem 1.25rem; }
.fxf-logbook-table { background: #fff; }
.fxf-logbook-table thead th { background: var(--fxf-gray); color: #fff; border: none; font-size: .85rem; }

/* ── Barcode scanning ────────────────────────────────────────────────────── */
/* Teal marks the scan affordances apart from the gray field furniture, so "point the
   camera here" reads at a glance on a counter tablet. */
.fxf-field-scan {
    background: var(--fxf-teal);
    color: #fff; border: none; cursor: pointer; font-weight: 700;
    padding: .65rem 1rem;
    display: flex; align-items: center; gap: .45rem; white-space: nowrap;
}
.fxf-field-scan:hover { background: var(--fxf-orange); color: #fff; }
.fxf-scan-btn { background: var(--fxf-teal); color: #fff; border: none; font-weight: 600; }
.fxf-scan-btn:hover { background: var(--fxf-orange); color: #fff; }

/* The ingredient row a scanned lot will land on. */
.fxf-logbook-row-armed > td { background: rgba(255, 130, 0, .10); }

/* What the last scan did. A counter scanner gives no other sign it fired, so this is the
   only confirmation on the hardware path. */
.fxf-scan-feedback {
    background: rgba(0, 150, 170, .10);
    border-left: 3px solid var(--fxf-teal);
    border-radius: 0 6px 6px 0;
    padding: .45rem .7rem;
    color: #22626d; font-size: .9rem; font-weight: 600;
}

/* Camera overlay. Sits above everything (including the dashboard filter panel at 1040). */
.fxf-scan-backdrop {
    position: fixed; inset: 0; z-index: 1080;
    background: rgba(0, 0, 0, .72);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.fxf-scan-panel {
    width: min(34rem, 100%); max-height: 100%; overflow-y: auto;
    background: #fff; border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
    display: flex; flex-direction: column;
}
.fxf-scan-head {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--fxf-teal); color: #fff; padding: .75rem 1rem;
    border-radius: 12px 12px 0 0;
}
.fxf-scan-title { font-weight: 700; }
.fxf-scan-close {
    background: none; border: none; color: #fff;
    font-size: 1.3rem; line-height: 1; cursor: pointer; padding: .1rem .45rem;
}
.fxf-scan-close:hover { color: var(--fxf-orange); }

.fxf-scan-stage { position: relative; background: #000; aspect-ratio: 4 / 3; overflow: hidden; }
.fxf-scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Aiming window: a bright frame with the rest of the field dimmed around it. */
.fxf-scan-reticle {
    position: absolute; left: 8%; right: 8%; top: 27%; bottom: 27%;
    border: 2px solid rgba(255, 255, 255, .9); border-radius: 10px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .3);
    pointer-events: none;
}
.fxf-scan-overlay {
    position: absolute; inset: 0; background: rgba(0, 0, 0, .6);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .6rem; padding: 1.25rem; text-align: center; color: #fff;
}
.fxf-scan-overlay .fxf-loading-msg { color: #fff; }
.fxf-scan-overlay-icon { font-size: 1.9rem; color: var(--fxf-orange); }

.fxf-scan-foot { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.fxf-scan-hint { margin: 0; color: #555; font-size: .9rem; min-height: 1.2rem; }
.fxf-scan-manual label { color: #666; }

/* ── Generator on a phone ────────────────────────────────────────────────── */
/* The desktop layout is a row of fixed-width label pills; at this width the label moves
   above its control and the LogBook's five-column ingredient grid restacks as cards.
   Every text control goes to 16px, below which iOS Safari zooms the page on focus. */
@media (max-width: 767.98px) {
    .fxf-main { padding: 1rem; }

    /* The shell's top bar is a single non-wrapping row sized for a desktop; at phone width the
       brand and the account controls together overflow, and the whole page scrolls sideways
       because of it. Let it wrap and let the title give up space first. */
    .fxf-topbar { flex-wrap: wrap; padding: .5rem .75rem; }
    .fxf-brand { min-width: 0; flex: 1 1 auto; }
    .fxf-brand img { height: 32px; }
    .fxf-brand-title {
        font-size: 1.05rem; min-width: 0;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .fxf-topbar-right { gap: .35rem; flex: 0 0 auto; }
    .fxf-cuslogo { max-width: 110px; }
    .fxf-account { font-size: .85rem; }

    .fxf-field { flex-wrap: wrap; margin-bottom: .5rem; }
    .fxf-field-label {
        flex: 1 0 100%; min-width: 0; justify-content: flex-start;
        padding: .45rem .8rem; font-size: .8rem;
        text-transform: uppercase; letter-spacing: .04em;
        border-radius: 6px 6px 0 0;
    }
    .fxf-field-input {
        flex: 1 1 8rem; font-size: 16px; padding: .7rem .8rem;
        border-left: 1px solid #cdcdcd;
    }
    .fxf-field-toggle { flex: 0 0 auto; padding: .5rem .75rem; font-size: .85rem; }
    .fxf-field-scan, .fxf-field-clear { padding: .7rem .9rem; border-right: 1px solid #cdcdcd; }
    .fxf-field-clear { border-right: none; }
    /* Icon only — the label is what the width is needed for. */
    .fxf-field-scan-text { display: none; }

    /* Comfortable thumb targets on the drug / bottle / flavor pick lists. */
    .fxf-list-item { padding: .95rem 1rem; }

    .fxf-flavor-key { display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
    .fxf-flavor-key span { margin-left: 0; }

    .fxf-gen-actions { flex-direction: column; }
    .fxf-gen-actions .btn { width: 100%; padding: .85rem; }

    .fxf-recipe { padding: 1rem; }
    .fxf-recipe-table th, .fxf-recipe-table td { padding: .5rem .4rem; }
    .fxf-logbook-body { padding: .9rem .8rem; }
    .fxf-logbook-body .form-control, .fxf-logbook-body .form-select { font-size: 16px; }

    /* Ingredient rows become labelled cards — the data-label on each cell is the heading
       the hidden <thead> would have supplied. */
    .fxf-logbook-table thead { display: none; }
    .fxf-logbook-table,
    .fxf-logbook-table tbody,
    .fxf-logbook-table tr,
    .fxf-logbook-table td { display: block; width: 100%; }
    .fxf-logbook-table tr {
        background: #fff; border: 1px solid #e2e2e6; border-radius: 10px;
        padding: .6rem .75rem; margin-bottom: .75rem;
    }
    .fxf-logbook-table tr.fxf-logbook-row-armed { border-color: var(--fxf-orange); }
    .fxf-logbook-table td { border: none; padding: .3rem 0; }
    .fxf-logbook-table td::before {
        content: attr(data-label); display: block;
        font-size: .7rem; font-weight: 700; letter-spacing: .04em;
        text-transform: uppercase; color: #777; margin-bottom: .15rem;
    }
    .fxf-logbook-table td[data-label=""]::before { content: none; }
}

/* Phone: the scanner takes the whole screen — a viewfinder in a small box is unusable. */
@media (max-width: 575.98px) {
    .fxf-scan-backdrop { padding: 0; }
    .fxf-scan-panel { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .fxf-scan-head { border-radius: 0; }
    .fxf-scan-stage { flex: 1 1 auto; aspect-ratio: auto; min-height: 42vh; }
}

/* Reveal animation for progressively-shown sections. */
@keyframes fxfReveal {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fxf-reveal { animation: fxfReveal .28s ease both; }

/* ── Dashboard floating filter panel ─────────────────────────────────────── */
/* Pinned top-right (fixed, clear of the sidebar) so the date range / account can be
   changed from any scroll position; collapses to a compact pill showing the active
   range and expands the card downward beneath it. The empty area of the container is
   click-through so it doesn't block the page underneath. */
.fxf-dash-filters {
    position: fixed;
    right: 350px;
    top: 80px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: min(20rem, calc(100vw - 2rem));
    pointer-events: none;
}
.fxf-dash-filters-toggle {
    pointer-events: auto; align-self: flex-end; max-width: 100%;
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--fxf-orange); color: #fff; font-weight: 700;
    border: none; border-radius: 999px; padding: .55rem 1rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28); cursor: pointer;
}
.fxf-dash-filters-toggle:hover { background: var(--fxf-red); }
.fxf-dash-filters-range { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fxf-dash-filters-body {
    pointer-events: auto; margin-top: .6rem;
    background: #fff; color: var(--fxf-text);
    border: 1px solid #e3e3e6; border-top: 3px solid var(--fxf-orange);
    border-radius: 12px; padding: 1rem; box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

/* ── Admin account approved-IP checkable list ────────────────────────────── */
.fxf-ip-list { max-height: 15rem; overflow-y: auto; background: #fff; }
.fxf-ip-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .4rem .7rem; margin: 0; cursor: pointer;
    border-bottom: 1px solid #f1f1f3;
}
.fxf-ip-item:last-child { border-bottom: none; }
.fxf-ip-item:hover { background: #f8f9fa; }
.fxf-ip-item.checked { background: rgba(255, 130, 0, .07); }
.fxf-ip-addr { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }
.fxf-ip-meta {
    margin-left: auto; display: flex; align-items: center; gap: .4rem;
    white-space: nowrap; font-size: .78rem;
}

/* ── Type-ahead picker (parent account on an individual user) ─────────────── *
   One control: type to search, arrow/Enter or click to choose. Once chosen the
   input is replaced by .fxf-picked, so a correct link is read, not re-picked.  */
.fxf-combo { position: relative; }
.fxf-combo-icon {
    position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
    color: var(--fxf-gray); pointer-events: none; font-size: .9rem;
}
.fxf-combo-input { padding-left: 2.1rem; }
.fxf-combo-spinner { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); }
.fxf-combo-list {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
    margin-top: 4px; max-height: 16rem; overflow-y: auto;
    background: #fff; border: 1px solid #dcdce0; border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
}
.fxf-combo-item {
    display: block; width: 100%; border: none; background: none; cursor: pointer;
    padding: .45rem .75rem; text-align: left; color: var(--fxf-text);
    border-bottom: 1px solid #f1f1f3;
}
.fxf-combo-item:last-child { border-bottom: none; }
.fxf-combo-item.active { background: var(--fxf-orange); color: #fff; }
.fxf-combo-item-name { font-weight: 600; }
.fxf-combo-item-meta { display: block; font-size: .78rem; color: var(--fxf-gray); }
.fxf-combo-item.active .fxf-combo-item-meta { color: rgba(255, 255, 255, .85); }
.fxf-combo-empty { padding: .55rem .75rem; font-size: .85rem; color: var(--fxf-gray); }

.fxf-picked {
    display: flex; align-items: center; gap: .5rem;
    padding: .45rem .6rem; border: 1px solid #dcdce0; border-radius: 8px;
    background: rgba(255, 130, 0, .07);
}
.fxf-picked-name { font-weight: 600; }
.fxf-picked-id { color: var(--fxf-gray); font-size: .8rem; }

/* Manual transaction log appended to the printout. Screen-hidden: the on-screen
   equivalent is the Save-to-LogBook form, which may be switched off (LOGBOOK_ENABLED)
   while the paper record still needs every one of its fields. */
.fxf-printlog { display: none; }

/* Print-optimized recipe output: hide chrome, show only the recipe card. */
@media print {
    body { background: #fff !important; }
    .navbar, .fxf-topbar, .fxf-sidebar, .fxf-footer, .d-print-none, #blazor-error-ui, .alert-info,
    .fxf-scan-backdrop { display: none !important; }
    .recipe-print { border: none !important; box-shadow: none !important; }
    main, .fxf-main { padding: 0 !important; }

    /* The log is the whole printout. Everything else on the generator — the drug/volume/
       flavor pickers and the recipe card's own tip and ingredient table — repeats what the
       log already carries, so only the log survives. Both rules stay scoped to .fxf-gen:
       the vet page reuses .recipe-print and has no log to fall back on. */
    .fxf-gen > *:not(.recipe-print) { display: none !important; }
    .fxf-gen .recipe-print > *:not(.fxf-printlog) { display: none !important; }
    /* Reveal animations can be captured mid-fade by the print renderer. */
    .fxf-reveal { animation: none !important; }

    /* Ruled boxes rather than form controls — the blanks are filled in by hand. */
    .fxf-printlog { display: block; break-inside: avoid; }
    .fxf-printlog-title {
        font-size: 1rem; font-weight: 800; text-transform: uppercase;
        border-bottom: 2px solid #000; padding-bottom: .15rem; margin-bottom: .5rem;
    }
    .fxf-printlog-section {
        font-size: .72rem; font-weight: 700; text-transform: uppercase;
        letter-spacing: .04em; margin: .55rem 0 .2rem;
    }
    .fxf-printlog-grid {
        display: grid; grid-template-columns: repeat(3, 1fr);
        gap: .1rem .9rem; break-inside: avoid;
    }
    /* NDC is fixed-width so the drug name keeps the rest of the line. */
    .fxf-printlog-grid-drug { grid-template-columns: 11rem 1fr; }
    .fxf-printlog-cell { display: flex; flex-direction: column; }
    .fxf-printlog-label { font-size: .62rem; color: #333; }
    .fxf-printlog-value {
        display: block; min-height: 1.15rem; font-size: .88rem;
        border-bottom: 1px solid #000;
        /* Long generic names wrap inside the cell rather than running past the rule; the
           box then fills the row so every underline on a row shares a baseline. */
        overflow-wrap: anywhere; flex: 1;
    }
    .fxf-printlog-table { width: 100%; border-collapse: collapse; break-inside: avoid; }
    .fxf-printlog-table th, .fxf-printlog-table td {
        border: 1px solid #000; padding: .15rem .35rem; font-size: .8rem; height: 1.5rem;
    }
    .fxf-printlog-table th { font-size: .68rem; text-transform: uppercase; text-align: left; }
    .fxf-printlog-tip { margin: 0; padding-left: 1.1rem; font-size: .8rem; font-weight: 700; }
    .fxf-printlog-note { margin: .2rem 0 0; font-size: .68rem; color: #333; }
    .fxf-printlog-notes {
        border: 1px solid #000; min-height: 2.6rem; padding: .2rem .35rem; font-size: .8rem;
    }
}