html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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;
}

/* Family recipe pages */
body:has(.recipe-page),
main:has(.recipe-page) {
    background: #fbf7f2;
}

.recipe-page {
    color: #2c2416;
    max-width: 1100px;
    font-size: 1.05rem;
    line-height: 1.5;
}

.recipe-reading {
    max-width: 46rem;
}

.recipe-page h1,
.recipe-page h2,
.recipe-page h3 {
    color: #2c2416;
    line-height: 1.2;
}

.recipe-page h1 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.recipe-page h2 {
    font-size: 1.4rem;
    margin: 1.5rem 0 0.75rem;
}

.recipe-page a:not(.btn):not(.recipe-card) {
    color: #8b3a2f;
}

.recipe-page a:not(.btn):not(.recipe-card):hover {
    color: #6f2d25;
}

.recipe-page .form-control,
.recipe-page .form-select,
.recipe-page .btn,
.quantity-choices button,
.quantity-fractions button,
.ingredient-suggestions button {
    min-height: 44px;
    font-size: 1rem;
}

.recipe-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.recipe-page .form-control:focus,
.recipe-page .form-select:focus {
    border-color: #8b3a2f;
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #8b3a2f;
}

.recipe-btn {
    background: #8b3a2f;
    border: 1px solid #8b3a2f;
    color: #fff;
}

.recipe-btn:hover,
.recipe-btn:focus {
    background: #732f26;
    border-color: #732f26;
    color: #fff;
}

.recipe-btn-secondary {
    background: #fff;
    border: 1px solid #c9b8a8;
    color: #2c2416;
}

.recipe-btn-secondary:hover,
.recipe-btn-secondary:focus {
    background: #fbf7f2;
    border-color: #8b3a2f;
    color: #2c2416;
}

.recipe-btn-danger {
    background: #fff;
    border: 1px solid #8b3a2f;
    color: #8b3a2f;
}

.recipe-btn-danger:hover,
.recipe-btn-danger:focus {
    background: #fff4f2;
    color: #6f2d25;
    border-color: #6f2d25;
}

.recipe-btn-lg {
    min-height: 52px;
    font-size: 1.15rem;
    padding: 0.8rem 1.3rem;
}

.recipe-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.recipe-page-header h1 {
    margin: 0;
}

.recipe-list-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 800px) {
    .recipe-list-filters {
        grid-template-columns: auto minmax(0, 1.4fr) minmax(12rem, 0.8fr) minmax(12rem, 0.7fr);
        align-items: end;
    }

    .recipe-list-filters .recipe-list-new-btn {
        align-self: end;
    }
}

.recipe-list-filters .recipe-field {
    margin-bottom: 0;
}

.recipe-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 600;
    margin-bottom: 0.9rem;
}

.recipe-field input,
.recipe-field textarea,
.recipe-field select {
    font-weight: 400;
}

.recipe-page textarea.form-control {
    min-height: 6rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 800px) {
    .recipe-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .recipe-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

a.recipe-card {
    display: flex;
    flex-direction: column;
    color: #2c2416;
    text-decoration: none;
    height: 100%;
    overflow: hidden;
    border: 1px solid #eadfd4;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(44, 36, 22, 0.06);
}

a.recipe-card:hover,
a.recipe-card:focus-visible {
    border-color: #8b3a2f;
    color: #2c2416;
}

a.recipe-card:focus-visible {
    outline: 3px solid #8b3a2f;
    outline-offset: 3px;
}

.recipe-card-media,
.recipe-card-placeholder {
    display: block;
    width: 100%;
    height: 11rem;
    object-fit: cover;
    background: #f3e6da;
}

.recipe-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.recipe-card h2 {
    font-size: 1.25rem;
    margin: 0 0 0.35rem;
}

.recipe-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    justify-content: space-between;
    margin: auto 0 0;
    color: #5c5143;
}

.recipe-card-comments {
    color: inherit;
}

.recipe-empty,
.recipe-hint,
.ingredient-line,
.step-line,
.recipe-comment,
.recipe-photo-card {
    background: #fff;
    border: 1px solid #eadfd4;
    border-radius: 14px;
}

.recipe-empty {
    padding: 2rem 1.25rem;
    text-align: center;
    border-style: dashed;
}

.recipe-empty p {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.recipe-hint {
    padding: 0.85rem 1rem;
    color: #5c5143;
}

.recipe-import {
    margin: 0.75rem 0;
}

.recipe-import .recipe-hint {
    margin: 0.5rem 0;
}

.recipe-import .recipe-btn {
    margin-top: 0.35rem;
}

.recipe-alert {
    background: #fff4f2;
    color: #6f2d25;
    border: 1px solid #e7c4be;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
}

.recipe-back {
    margin-bottom: 0.5rem;
}

.recipe-byline,
.recipe-scale-original,
.recipe-scale-hint,
.recipe-note,
.ingredient-category {
    color: #5c5143;
}

.recipe-copy {
    white-space: pre-wrap;
}

.recipe-hero {
    width: 100%;
    max-height: 28rem;
    object-fit: cover;
    border-radius: 14px;
    background: #f3e6da;
    margin-bottom: 0.75rem;
}

.recipe-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem 0 0.5rem;
}

.recipe-thumbs button {
    padding: 0;
    border: 3px solid transparent;
    background: none;
    border-radius: 10px;
    min-width: 72px;
    min-height: 72px;
}

.recipe-thumbs button.selected {
    border-color: #8b3a2f;
}

.recipe-thumbs img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    background: #f3e6da;
}

.recipe-scale-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #eadfd4;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(44, 36, 22, 0.08);
}

.recipe-scale-bar .recipe-field {
    margin: 0;
}

.recipe-scale-servings {
    width: 6.5rem;
}

.recipe-scale-original,
.recipe-scale-hint,
.recipe-confirm {
    margin: 0;
}

.recipe-scale-hint {
    flex-basis: 100%;
}

.recipe-ingredients {
    padding-left: 1.25rem;
    margin: 0;
}

.recipe-ingredients li {
    padding: 0.15rem 0;
    line-height: 1.45;
}

.recipe-amount {
    font-weight: 700;
}

.recipe-optional {
    color: #8b3a2f;
    font-weight: 600;
}

.recipe-steps {
    padding-left: 1.25rem;
}

.recipe-steps li {
    margin: 0.65rem 0;
    white-space: pre-wrap;
}

.recipe-actions,
.recipe-line-actions,
.recipe-photo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.recipe-detail-header .recipe-actions,
.recipe-save-row {
    margin: 0.75rem 0 1rem;
}

.recipe-comment {
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
}

.recipe-comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    color: #5c5143;
    margin-bottom: 0.4rem;
}

.recipe-comment p {
    white-space: pre-wrap;
    margin-bottom: 0.6rem;
}

.recipe-comment-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.recipe-comment-photo-thumb {
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
}

.recipe-comment-photos img {
    max-height: 8rem;
    max-width: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.recipe-comment-photo-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(44, 36, 22, 0.62);
}

.recipe-comment-photo-dialog {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
}

.recipe-comment-photo-close {
    flex-shrink: 0;
}

.recipe-comment-photo-enlarged {
    display: block;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 5rem);
    object-fit: contain;
    border-radius: 10px;
}

.ingredient-line,
.step-line {
    padding: 0.9rem;
    margin-bottom: 0.75rem;
}

.ingredient-line-import-warning {
    background: #fff4f2;
    border-color: #e7c4be;
}

.ingredient-line:has(.ingredient-line-summary) {
    padding: 0;
    border: none;
    background: transparent;
}

.ingredient-line-import-warning:has(.ingredient-line-summary) {
    background: transparent;
    border: none;
}

.ingredient-line-import-warning:has(.ingredient-line-summary) .ingredient-line-summary {
    background: #fff4f2;
    border-color: #c45c4a;
}

.ingredient-line-import-warning:has(.ingredient-line-summary) .ingredient-line-summary:hover,
.ingredient-line-import-warning:has(.ingredient-line-summary) .ingredient-line-summary:focus {
    background: #fff4f2;
    border-color: #8b3a2f;
}

.ingredient-line-warning {
    margin: 0.35rem 0 0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #6f2d25;
}

.ingredient-line:has(.ingredient-line-summary) .ingredient-line-warning {
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.ingredient-line-summary {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.75rem;
    border: 1px solid #e0d2c4;
    border-radius: 10px;
    background: #fbf7f2;
    color: #2c2416;
    font-weight: 600;
    line-height: 1.45;
}

.ingredient-line-summary:hover,
.ingredient-line-summary:focus {
    border-color: #8b3a2f;
    background: #fff;
}

.recipe-leave-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(44, 36, 22, 0.45);
}

.recipe-leave-dialog {
    width: min(100%, 26rem);
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #eadfd4;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(44, 36, 22, 0.18);
}

.recipe-leave-dialog h2 {
    font-size: 1.35rem;
    margin: 0 0 0.5rem;
}

.recipe-leave-dialog p {
    margin: 0 0 1rem;
    color: #5c5143;
}

.recipe-leave-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recipe-start-choices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recipe-start-choices .recipe-btn {
    width: 100%;
}

.recipe-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.recipe-check input {
    width: 1.25rem;
    height: 1.25rem;
}

.quantity-editor {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

.quantity-choices,
.quantity-fractions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.quantity-choices button,
.quantity-fractions button {
    border-radius: 10px;
    border: 1px solid #e0d2c4;
    background: #fff;
    color: #2c2416;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
}

.quantity-choices button {
    flex: 1 1 6.5rem;
}

.quantity-fractions button {
    min-width: 44px;
}

.quantity-choices button[aria-pressed="true"],
.quantity-fractions button[aria-pressed="true"] {
    background: #8b3a2f;
    border-color: #8b3a2f;
    color: #fff;
}

.quantity-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

@media (min-width: 800px) {
    .quantity-fields {
        grid-template-columns: 8.5rem 1fr;
        align-items: end;
    }
}

.ingredient-name {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ingredient-suggestions {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0.25rem;
    position: absolute;
    z-index: 6;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #eadfd4;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(44, 36, 22, 0.12);
    max-height: 16rem;
    overflow: auto;
}

.ingredient-suggestions button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: #2c2416;
    padding: 0.45rem 0.7rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border-radius: 8px;
}

.ingredient-suggestions button:hover,
.ingredient-suggestions button:focus {
    background: #fbf7f2;
}

.recipe-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.recipe-photo-card {
    padding: 0.6rem;
}

.recipe-photo-card img {
    width: 100%;
    height: 9rem;
    object-fit: cover;
    border-radius: 10px;
    background: #f3e6da;
    margin-bottom: 0.55rem;
}

.recipe-photo-picker-dialog {
    width: min(100%, 36rem);
}

.recipe-photo-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 24rem;
    overflow: auto;
}

.recipe-photo-picker-cell {
    display: block;
    padding: 0;
    border: 2px solid #eadfd4;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
}

.recipe-photo-picker-cell.is-selected {
    border-color: #8b3a2f;
    box-shadow: 0 0 0 2px rgba(139, 58, 47, 0.25);
}

.recipe-photo-picker-cell img {
    width: 100%;
    height: 6.5rem;
    object-fit: cover;
    display: block;
    background: #f3e6da;
}

.recipe-photo-pending-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5c5143;
    margin: 0 0 0.55rem;
    word-break: break-word;
}

.recipe-file {
    position: relative;
    overflow: hidden;
}

.recipe-file input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 1rem;
}

.recipe-comments {
    margin-top: 1.5rem;
    padding-bottom: 2rem;
}