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+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;
}

/* Drop the Location column below phone width. Originally written for the old Animals grid
   (now a row list, #42); still used by the Breeding season grid (Breeding.razor), so it
   stays. Must be global, not in a scoped .razor.css: MudDataGrid renders its cells through
   enough internal component layers that Blazor's CSS-isolation scope attribute never
   reaches them, so a scoped (even ::deep) rule silently matches nothing. Combined with
   .mud-table-cell (also on the same element) so it beats MudBlazor's own
   ".mud-table-cell{display:table-cell}" rule on specificity instead of stylesheet order. */
@media (max-width: 600px) {
    .mud-table-cell.location-column {
        display: none;
    }
}

/* Breeding season grid (Breeding.razor) date range: below phone width, keep it on one line
   so it can't wrap mid-value and cascade down the cell (issue #2). Phone-scoped like the
   Location rule above — no reason to constrain wrapping on the roomy desktop table, and the
   reported bug is phone-only. Same scoping issue as that rule: must be global, not in
   Breeding.razor.css, or it never matches; combined with .mud-table-cell to win on
   specificity rather than stylesheet order. */
@media (max-width: 600px) {
    .mud-table-cell.season-dates-column {
        white-space: nowrap;
    }
}

/* ---- Herd list (Animals.razor, spec #38 Layout A) -------------------------------- */
/* Two-line rows, the yellow ear-tag badge, and the Pregnant/Bred/Open repro badges.
   Global rather than Animals.razor.css: the rows are plain HTML (which scoped CSS WOULD
   reach), but the ear tag + badges are meant to be reused (the desktop table in #44, Home),
   and a global rule can't silently stop matching if a MudBlazor wrapper ever ends up
   between the page and the element. Colors are the prototype's tokens, kept as custom
   properties so the tag/badge palette is named once. Any token whose color is already in
   AppTheme.cs's palette points at MudBlazor's --mud-palette-* variable instead of repeating
   the hex, so AppTheme stays the one place those colors are set; only the genuinely new
   colors (ear-tag yellow, badges, ink/muted/line) are spelled out here. */
:root {
    --herd-surface: var(--mud-palette-surface); /* AppTheme Surface */
    --herd-surface-2: var(--mud-palette-drawer-background); /* AppTheme DrawerBackground (tan) */
    --herd-ink: #252A20;
    --herd-muted: #676B58;
    --herd-line: #DDD8C7;
    --herd-bg: var(--mud-palette-background); /* AppTheme Background */
    --ear-tag: #EDC63E;
    --ear-tag-edge: #C29E22;
    --ear-tag-ink: #2A250C;
    --repro-pregnant-bg: #DCE8D3;
    --repro-pregnant-ink: #2F5527;
    --repro-bred-bg: #F5E3CF;
    --repro-bred-ink: #8A4F17;
    --repro-open-bg: #ECE9DE;
    --repro-open-ink: #5B5E4D;
    --herd-primary-soft: #E2EBDB;
    --herd-left-bg: #EFE4E1;
    --herd-left-ink: #8A3B2C;
    --herd-num-font: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
}

/* Muted helper text (e.g. "12 shown"). Combined with .mud-typography so it beats
   MudText's own color rule regardless of stylesheet order. */
.herd-muted,
.mud-typography.herd-muted {
    color: var(--herd-muted);
}

/* The list card: one rounded white panel, rows divided by hairlines. */
.herd-list {
    background: var(--herd-surface);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(40, 45, 30, .08), 0 6px 18px rgba(40, 45, 30, .07);
    overflow: hidden;
}

/* A row is a real <button> (keyboard + screen-reader friendly), reset to look like a list row. */
.herd-row {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--herd-line);
    background: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--herd-ink);
}

.herd-row:first-child {
    border-top: 0;
}

.herd-row:hover {
    background: var(--herd-surface-2);
}

/* min-width: 0 lets the text column shrink so long lines ellipsize instead of pushing the
   repro badge off the right edge on a phone. */
.herd-row-main {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 1px;
}

.herd-row-l1 {
    font-weight: 700;
    font-size: 15.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.herd-row-name {
    font-weight: 500;
    color: var(--herd-muted);
}

.herd-row-l2 {
    font-size: 13.5px;
    color: var(--herd-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Selection checkbox (#45 bulk move): a drawn box, ticked via ::after. Used on the phone rows
   in selection mode and in the desktop table's always-on checkbox column. */
.herd-check {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 2px solid var(--herd-muted);
    display: grid;
    place-items: center;
    background: var(--herd-surface);
}

.herd-check.on {
    background: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
}

.herd-check.on::after {
    content: "";
    width: 6px;
    height: 11px;
    border: solid var(--mud-palette-primary-text);
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* The ear tag: yellow tag body, slightly rounded "tag" shape (rounder at the top), a punched
   hole (the ::before circle, filled with the page background so it reads as a hole), and a
   condensed bold number. padding-top pushes the number below the hole. */
.ear-tag {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 42px;
    padding-top: 7px;
    background: var(--ear-tag);
    color: var(--ear-tag-ink);
    border: 1.5px solid var(--ear-tag-edge);
    border-radius: 14px 14px 10px 10px;
    font-family: var(--herd-num-font);
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.ear-tag::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    border-radius: 50%;
    background: var(--herd-bg);
    border: 1.5px solid var(--ear-tag-edge);
}

/* Small size, for the desktop table (#44). */
.ear-tag.sm {
    width: 38px;
    height: 34px;
    font-size: 17px;
    padding-top: 6px;
    border-radius: 12px 12px 8px 8px;
}

.ear-tag.sm::before {
    top: 3px;
    width: 6px;
    height: 6px;
    margin-left: -3px;
}

/* Long tags (more than 2 characters, e.g. "Y14") step the font down so they still fit. */
.ear-tag.long {
    font-size: 15px;
}

/* Repro badge: a small pill on the right of line 1, cows and heifers only. */
.repro-badge {
    flex: none;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.repro-badge.pregnant {
    background: var(--repro-pregnant-bg);
    color: var(--repro-pregnant-ink);
}

.repro-badge.bred {
    background: var(--repro-bred-bg);
    color: var(--repro-bred-ink);
}

.repro-badge.open {
    background: var(--repro-open-bg);
    color: var(--repro-open-ink);
}

/* ---- Herd sorting + desktop table (Animals.razor, #44) --------------------------- */
/* Phone vs desktop switch: Animals.razor renders BOTH the two-line row list and the table,
   and these two rules show exactly one. 960px = MudBlazor's Md breakpoint (the drawer's),
   so the switch lines up with the rest of the shell. Pure CSS, so the right layout is there
   from the very first (prerendered) paint — no JS breakpoint round-trip. */
@media (min-width: 960px) {
    .herd-phone-only {
        display: none !important;
    }
}

@media (max-width: 959.98px) {
    .herd-desk-only {
        display: none !important;
    }
}

/* Phone Sort menu: keep the MudSelect compact so it sits on the list bar next to the count. */
.herd-sort-menu {
    width: 170px;
}

/* Muted dash for a blank table cell. */
.herd-dash {
    color: var(--herd-muted);
}

/* The table card: same rounded white panel as the row list. overflow-x: auto so a narrow
   desktop window (drawer open, 960–1100px) scrolls the table sideways rather than the page. */
.herd-table-wrap {
    background: var(--herd-surface);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(40, 45, 30, .08), 0 6px 18px rgba(40, 45, 30, .07);
    overflow-x: auto;
}

.herd-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    color: var(--herd-ink);
}

/* Headings: small uppercase muted labels. The <th> itself has no padding — the <button>
   inside carries it, so the whole heading cell is the click target. */
.herd-table th {
    text-align: left;
    font-size: 11.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--herd-muted);
    font-weight: 700;
    padding: 0;
    border-bottom: 1.5px solid var(--herd-line);
    background: var(--herd-surface);
}

.herd-table th button {
    border: 0;
    background: none;
    padding: 12px 10px;
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
    display: inline-flex;
    gap: 4px;
    align-items: center;
    white-space: nowrap;
}

/* The active sort column's heading, in the theme's primary green. */
.herd-table th button.on {
    color: var(--mud-palette-primary);
}

.herd-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--herd-line);
    font-size: 14.5px;
    white-space: nowrap;
}

.herd-table tbody tr {
    cursor: pointer;
}

.herd-table tbody tr:last-child td {
    border-bottom: 0;
}

.herd-table tbody tr:hover td {
    background: var(--herd-surface-2);
}

.herd-table td.herd-table-name {
    font-weight: 600;
}

/* A table row for an animal that has left the Herd (only listed while "+ Sold & gone" is
   on): muted text and a neutral grey ear tag, matching .herd-row.is-left on the phone. */
.herd-table tbody tr.is-left td {
    color: var(--herd-muted);
}

.herd-table tbody tr.is-left .ear-tag {
    background: var(--herd-surface-2);
    border-color: var(--herd-line);
    color: var(--herd-muted);
}

/* Desktop checkbox column (#45): always shown, select-all in the heading. */
.herd-table th.herd-table-check,
.herd-table td.herd-table-check {
    width: 44px;
    padding-left: 14px;
}

/* The clickable wrapper around each desktop .herd-check (row box + select-all). A bare
   <button> with the browser chrome stripped, so only the drawn box shows, but it still takes
   keyboard focus. The padding (cancelled out by the negative margin) grows the click target
   past the 24px box without shifting the layout. */
.herd-check-btn {
    display: inline-grid;
    place-items: center;
    padding: 4px;
    margin: -4px;
    border: 0;
    background: none;
    border-radius: 9px;
    cursor: pointer;
}

.herd-check-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.herd-check-btn:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 1px;
}

/* ===== Herd filters (#43): location tiles, class chips, "+ Sold & gone", left rows ===== */

/* Location tiles: head count over the location name. auto-fill wraps onto more rows as
   locations are added; on a phone the usual three (All head / Malone / Peasleeville) sit
   side by side. */
.herd-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 8px;
}

@media (min-width: 960px) {
    .herd-tiles {
        grid-template-columns: repeat(auto-fill, minmax(140px, 200px));
    }
}

.herd-tile {
    border: 1.5px solid var(--herd-line);
    background: var(--herd-surface);
    border-radius: 12px;
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
    display: grid;
    gap: 1px;
    font: inherit;
    color: var(--herd-ink);
}

.herd-tile-n {
    font-family: var(--herd-num-font);
    font-weight: 700;
    font-size: 24px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.herd-tile-l {
    font-size: 12.5px;
    color: var(--herd-muted);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The selected tile: primary-green border on a soft green fill. */
.herd-tile[aria-pressed="true"] {
    border-color: var(--mud-palette-primary);
    background: var(--herd-primary-soft);
}

.herd-tile[aria-pressed="true"] .herd-tile-l {
    color: var(--mud-palette-primary);
}

/* Class chips: pills that wrap onto a second line on a narrow phone. */
.herd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.herd-chip {
    border: 1.5px solid var(--herd-line);
    background: var(--herd-surface);
    border-radius: 999px;
    padding: 5px 12px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    color: var(--herd-ink);
}

.herd-chip[aria-pressed="true"] {
    background: var(--mud-palette-primary);
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

/* "+ Sold & gone": quieter (muted, dashed) until on, then the reddish "left" colors so it
   reads as "you're now seeing animals that have left". */
.herd-chip.quiet {
    color: var(--herd-muted);
    border-style: dashed;
}

.herd-chip.quiet[aria-pressed="true"] {
    background: var(--herd-left-bg);
    color: var(--herd-left-ink);
    border-color: var(--herd-left-ink);
    border-style: solid;
}

/* A row for an animal that has left the Herd: muted line 1 and a neutral grey ear tag. */
.herd-row.is-left .herd-row-l1 {
    color: var(--herd-muted);
}

.herd-row.is-left .ear-tag {
    background: var(--herd-surface-2);
    border-color: var(--herd-line);
    color: var(--herd-muted);
}

/* Its Sold / Deceased / Slaughtered / Returned pill, in place of the repro badge. */
.repro-badge.left {
    background: var(--herd-left-bg);
    color: var(--herd-left-ink);
}

/* Selection mode: the same footprint as .herd-check, empty, for rows that can't be selected. */
.herd-check-spacer {
    flex: none;
    width: 24px;
    height: 24px;
}

/* "No animals match" panel. */
.herd-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--herd-muted);
    display: grid;
    justify-items: center;
    gap: 8px;
}

/* ---- Navigation shell (issue #41, spec #38) ------------------------------------------ */
/* MainLayout + SideRail + BottomNav + the More page. All global, not scoped: most of these
   style MudBlazor-rendered elements (MudAppBar's toolbar, MudMainContent, MudIcon's <svg>),
   which carry no Blazor CSS-isolation scope attribute (CLAUDE.md's CSS-isolation gotcha).
   Breakpoint: MudBlazor's Md, 960px — below it is the phone shell (compact app bar + fixed
   bottom bar), from it up is the desktop shell (persistent side rail). Colors are the
   prototype's "Back Pasture" chrome tokens (dark-green bar, warm ink, muted sage). */
:root {
    --shell-appbar-height: 56px;
    /* Height of the phone bottom bar (BottomNav, or a page's own replacement bar wearing the
       same .shell-bottombar class). Page content gets this much bottom padding — see
       .shell-main below — so nothing hides behind the bar. */
    --shell-bottombar-height: 70px;
    --shell-rail-width: 232px;
    --shell-bar-ink: var(--mud-palette-appbar-text);
    --shell-bar-muted: #B9C4AE;
    --shell-line: #DDD8C7;
    --shell-muted: #676B58;
    --shell-primary-soft: #E2EBDB;
}

/* Phone app bar: compact (56px rather than MudBlazor's 64px), brand only. */
.shell-appbar.mud-appbar .mud-toolbar {
    height: var(--shell-appbar-height);
    min-height: var(--shell-appbar-height);
}

.shell-appbar-title {
    font-family: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: 0.02em;
}

.mud-icon-root.shell-brand-mark {
    font-size: 26px;
    flex: none;
}

/* Page content offsets. Phone: clear the app bar on top, and the fixed bottom bar at the
   bottom (+ the phone's home-indicator inset, + a little breathing room) — the
   bottom-padding hook. Desktop: no app bar, no bottom bar; shift right past the rail. */
.shell-main.mud-main-content {
    padding-top: var(--shell-appbar-height);
    padding-bottom: calc(var(--shell-bottombar-height) + env(safe-area-inset-bottom, 0px) + 16px);
}

@media (min-width: 960px) {
    .shell-main.mud-main-content {
        padding-top: 0;
        padding-bottom: 0;
        margin-left: var(--shell-rail-width);
    }
}

/* Desktop side rail. */
.shell-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    width: var(--shell-rail-width);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 12px;
    overflow-y: auto;
    background-color: var(--mud-palette-appbar-background, #2F4A29);
    color: var(--shell-bar-ink);
}

@media (max-width: 959.98px) {
    .shell-rail {
        display: none;
    }
}

.shell-rail-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 18px;
}

.shell-rail-brand .mud-icon-root.shell-brand-mark {
    font-size: 32px;
}

.shell-brand-text {
    display: grid;
    line-height: 1.05;
}

.shell-brand-text b {
    font-family: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 21px;
    letter-spacing: 0.02em;
}

.shell-brand-text span {
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--shell-bar-muted);
}

/* One rail destination — used on <a> links AND the sign-out <button>, so the button's
   browser defaults (border, background, font) are reset to look identical. */
.shell-rail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.shell-rail-item .mud-icon-root {
    font-size: 20px;
    opacity: 0.85;
}

.shell-rail-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.shell-rail-item[aria-current="page"] {
    background-color: rgba(255, 255, 255, 0.13);
}

/* "Farm" / "Admin" section headings. */
.shell-rail-label {
    padding: 14px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--shell-bar-muted);
}

/* Pushes Sign out + version to the bottom of the rail. */
.shell-rail-spacer {
    flex: 1;
}

/* Watermark, not a headline — deliberately low-contrast. */
.shell-rail-version {
    padding: 8px 12px 0;
    font-size: 11px;
    color: var(--shell-bar-muted);
    opacity: 0.7;
}

/* Fixed-bottom bar slot (phone only). Worn by BottomNav AND by any page's own replacement bar
   while it has hidden BottomNav through BottomNavState (e.g. the Herd selection bar, #45), so
   either one lands in the same spot and the page's bottom padding above still clears it. */
.shell-bottombar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    box-sizing: border-box;
    min-height: calc(var(--shell-bottombar-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* !important on purpose: every bar wearing .shell-bottombar also sets its own display LATER
   in this file with equal specificity (.shell-bottomnav → grid, .herd-selectbar → flex), and
   a plain "display: none" here lost that cascade tie — the phone bottom nav showed on desktop
   too, covering the side rail's Sign out. This hide must win over any bar's own layout. */
@media (min-width: 960px) {
    .shell-bottombar {
        display: none !important;
    }
}

/* The four-tab nav itself: Home · Herd · Breeding · More. */
.shell-bottomnav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    padding-left: 4px;
    padding-right: 4px;
    background-color: var(--mud-palette-surface, #FFFFFF);
    border-top: 1px solid var(--shell-line);
}

.shell-bottomnav a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 4px 0;
    color: var(--shell-muted);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.shell-bottomnav-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 28px;
    border-radius: 14px;
}

.shell-bottomnav-icon .mud-icon-root {
    font-size: 22px;
}

/* Current tab: green label + a soft green "pill" behind the icon (Material 3 style). */
.shell-bottomnav a[aria-current="page"] {
    color: var(--mud-palette-primary, #3F6B35);
}

.shell-bottomnav a[aria-current="page"] .shell-bottomnav-icon {
    background-color: var(--shell-primary-soft);
}

/* More page (phone): grouped menu cards — Farm Setup; Admin → Users / Settings; Sign out. */
.shell-menu {
    overflow: hidden;
    margin-bottom: 14px;
    border-radius: 14px;
    background-color: var(--mud-palette-surface, #FFFFFF);
    box-shadow: 0 1px 2px rgba(40, 45, 30, 0.08), 0 6px 18px rgba(40, 45, 30, 0.07);
}

/* One menu row — <a> links and the sign-out <button> share it, hence the button resets. */
.shell-menu-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    box-sizing: border-box;
    padding: 15px 16px;
    border: 0;
    border-top: 1px solid var(--shell-line);
    background: none;
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.shell-menu-row:first-child {
    border-top: 0;
}

.shell-menu-row .mud-icon-root {
    flex: none;
    font-size: 22px;
    color: var(--mud-palette-primary, #3F6B35);
}

.shell-menu-hint {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--shell-muted);
}

.shell-menu-chevron {
    margin-left: auto;
    color: var(--shell-muted);
}

.shell-menu-label {
    padding: 6px 4px 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--shell-muted);
}

.shell-menu-version {
    text-align: center;
    font-size: 11px;
    color: var(--shell-muted);
    opacity: 0.7;
}

/* ---- Auth screens (Step 10) ------------------------------------------------------ */
/* Centered login card on the warm off-white background. The login form uses native
   inputs (they must post in a full-page form submit — see Login.razor), styled here to
   sit comfortably alongside MudBlazor's own components. */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: var(--mud-palette-background, #F6F4EC);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--mud-palette-lines-inputs, rgba(0, 0, 0, 0.3));
    border-radius: var(--mud-default-borderradius, 4px);
    background-color: var(--mud-palette-surface, #fff);
    color: var(--mud-palette-text-primary);
}

.auth-input:focus {
    outline: none;
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 1px var(--mud-palette-primary);
}

/* "or sign in with email" separator on the login page. A classic centered-label rule
   (two flex-grown pseudo-element lines either side of the text) instead of two MudDividers
   in a flex row — the latter overflowed the card and wrapped the label vertically. Lives in
   global app.css because scoped CSS can't reliably target MudBlazor internals anyway, and
   this is used from the login card. */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--mud-palette-text-secondary);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1 1 auto;
    border-bottom: 1px solid var(--mud-palette-divider, rgba(0, 0, 0, 0.12));
}

.auth-divider span {
    padding: 0 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* AnimalDetailDialog's loading placeholder (issue #27): sized like the AnimalPhotoCapture mug-shot
   banner it stands in for (4:3 phone, 16:9 from md up — same breakpoint as AnimalPhotoCapture.razor.css)
   so its space is held while loading. Global, not scoped: MudSkeleton is a
   MudBlazor component, so a scoped rule wouldn't reach it (see CLAUDE.md's CSS-isolation gotcha). */
.mud-skeleton.mugshot-skeleton {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: var(--mud-default-borderradius);
}

@media (min-width: 960px) {
    .mud-skeleton.mugshot-skeleton {
        aspect-ratio: 16 / 9;
    }
}

/* ---- Home herd summary (Home.razor, #46 / spec #38) -------------------------------- */
/* Date eyebrow, big head count, the two action buttons and one card per location. Global
   (not Home.razor.css) to sit beside the Herd styles whose tokens it reuses
   (--herd-* / --mud-palette-primary) — no new colors. The action buttons are MudButtons, so
   only their grid wrapper (plain HTML) is styled here. */
.home-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--herd-muted);
    font-weight: 700;
}

.home-hero-count {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-height: 58px;
}

.home-hero-big {
    font-family: var(--herd-num-font);
    font-weight: 700;
    font-size: 64px;
    line-height: 0.9;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-primary);
}

.home-hero-what {
    font-size: 16px;
    color: var(--herd-muted);
    font-weight: 500;
}

/* Two equal-width buttons side by side, even on a phone. */
.home-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Location cards: one column on a phone, two from md (960px) up. */
.home-loccards {
    display: grid;
    gap: 10px;
}

@media (min-width: 960px) {
    .home-loccards {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

.home-loccard {
    border: 1.5px solid var(--herd-line);
    background: var(--herd-surface);
    border-radius: 14px;
    padding: 14px 16px;
    display: grid;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--herd-ink);
    box-shadow: var(--mud-elevation-1);
}

.home-loccard:hover {
    border-color: var(--mud-palette-primary);
}

.home-loccard-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.home-loccard-name {
    font-family: var(--herd-num-font);
    font-size: 22px;
    font-weight: 700;
}

.home-loccard-head {
    font-family: var(--herd-num-font);
    font-weight: 700;
    font-size: 26px;
    color: var(--mud-palette-primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.home-loccard-head small {
    font-size: 13px;
    color: var(--herd-muted);
    font-weight: 600;
    margin-left: 4px;
}

/* The 5-way class breakdown: Cows / Heifers / Calves / Bulls / Steers in one row. */
.home-classgrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    border-top: 1px solid var(--herd-line);
    padding-top: 10px;
}

.home-classgrid-cell {
    display: grid;
    min-width: 0;
}

.home-classgrid-cell b {
    font-family: var(--herd-num-font);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.home-classgrid-cell span {
    font-size: 12px;
    color: var(--herd-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-loccard-go {
    font-size: 13px;
    color: var(--mud-palette-primary);
    font-weight: 700;
}

/* ===== Herd bulk move + Add-animal placement (#45) ===== */

/* Page header: title on the left, the desktop "Add animal" button on the right (a phone hides
   that button — it uses the floating one below instead). */
.herd-pagehead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* Desktop "N selected · Move to…" pill: dark app-bar green with an orange action, as in the
   prototype's .selpill. Only rendered while something is ticked. */
.herd-selpill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px 6px 14px;
    border-radius: 10px;
    background: var(--mud-palette-appbar-background, #2F4A29);
    color: var(--shell-bar-ink);
    font-weight: 600;
    font-size: 14px;
}

.herd-selpill button {
    border: 0;
    border-radius: 8px;
    padding: 7px 12px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    background: var(--mud-palette-secondary, #C8793A);
    color: var(--mud-palette-secondary-text);
}

/* Phone floating "Add animal" button: fixed bottom-right, floating just above the bottom bar
   (bar height + the phone's safe-area inset + a 14px gap). Barn orange, Material-style
   extended FAB. Same z-index as the bottom bar — below MudBlazor's dialogs/overlays, so an
   open dialog still covers it. Hidden on desktop by .herd-phone-only. */
.herd-fab {
    position: fixed;
    right: 16px;
    bottom: calc(var(--shell-bottombar-height) + env(safe-area-inset-bottom, 0px) + 14px);
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 20px 0 16px;
    border: 0;
    border-radius: 16px;
    background: var(--mud-palette-secondary, #C8793A);
    color: var(--mud-palette-secondary-text);
    font: inherit;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.herd-fab .mud-icon-root {
    font-size: 22px;
}

/* Room under the last phone row so the floating button never covers it (56px button + its
   gap; the page's own bottom padding already clears the bar itself). */
.herd-fab-spacer {
    height: 72px;
}

/* Phone selection bar: takes the bottom nav's spot (the shared .shell-bottombar provides the
   fixed position, height, safe-area padding and desktop hiding). "N selected" fills the
   left; Cancel (quiet) and Move to… (orange) sit on the right. */
.herd-selectbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 14px;
    padding-right: 14px;
    background: var(--mud-palette-appbar-background, #2F4A29);
    color: var(--shell-bar-ink);
}

.herd-selectbar-count {
    flex: 1;
    font-weight: 600;
}

.herd-selectbar button {
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.herd-selectbar-cancel {
    background: transparent;
    color: var(--shell-bar-ink);
}

.herd-selectbar-go {
    background: var(--mud-palette-secondary, #C8793A);
    color: var(--mud-palette-secondary-text);
}

.herd-selectbar-go:disabled {
    opacity: 0.45;
    cursor: default;
}
