:root {
    --bottom-menu-height: 70px;
    --bottom-menu-extra: 10px;
}

.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: calc(
        var(--bottom-menu-height) +
        env(safe-area-inset-bottom, 0px) +
        var(--bottom-menu-extra)
    );
    display: flex;
    background: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1050;
    padding-bottom: calc(
        env(safe-area-inset-bottom, 0px) +
        var(--bottom-menu-extra)
    );
}

.bottom-menu-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 2px;
    color: #6c757d;
    text-decoration: none;
    font-size: 12px;
}

.bottom-menu-item i {
    font-size: 22px;
}

.bottom-menu-item:hover,
.bottom-menu-item:focus {
    color: #0d6efd;
}

.bottom-menu-item.active {
    color: #0d6efd;
    font-weight: 600;
}

.submit-bar {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    z-index: 1040;
    background: white;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

body {
    padding-bottom: 150px;
}

/* Larger Bootstrap switches */
.form-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    margin-left: -2.5rem;
}

.form-switch .form-check-input:checked {
    background-color: #0d6efd;
}

/* Shopping list: easier-to-tap items */
.shopping-list-row .form-check {
    padding: 8px 0 8px 2rem;
    min-height: 44px;
}

.shopping-list-row .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-left: -2rem;
    margin-top: 0.2rem;
}

.shopping-list-row .form-check-label {
    font-size: 1rem;
    line-height: 1.5;
    cursor: pointer;
}

@media (max-width: 576px) {
    .shopping-list-row .form-check {
        padding-top: 10px;
        padding-bottom: 10px;
        min-height: 48px;
    }

    .shopping-list-row .form-check-input {
        width: 1.4rem;
        height: 1.4rem;
    }

    .shopping-list-row .form-check-label {
        font-size: 1.05rem;
    }
}

/* Planning page: recipe tiles */
.recipe-card {
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease,
                background-color 0.15s ease;
}

.recipe-card.selected {
    border-color: var(--bs-primary);
    background-color: #e7f1ff;
}

.recipe-check {
    width: 30px;
    height: 30px;
    border: 2px solid #adb5bd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recipe-card.selected .recipe-check {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.recipe-check svg {
    display: none;
}

.recipe-card.selected .recipe-check svg {
    display: block;
}

.recipe-card-image {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
}

.recipe-card .card-body {
    display: flex;
    align-items: flex-start;
    padding: 0.65rem;
}

.recipe-card-title {
    line-height: 1.3;
    overflow-wrap: anywhere;
    margin: 0;
}

@media (max-width: 576px) {
    .recipe-card-image {
        height: 100px;
    }

    .recipe-card .card-body {
        padding: 0.5rem;
    }

    .recipe-card-title {
        font-size: 0.85rem;
    }
}

/* Recipe images and ingredient layout */
.plan-recipe-thumbnail {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.recipe-view-image {
    display: block;
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
}

@media (max-width: 767.98px) {
    .recipe-view-image {
        max-height: 260px;
    }

    .recipe-ingredients-layout {
        display: flex;
        flex-direction: column;
    }

    .recipe-ingredients-layout .recipe-image-column {
        order: 1;
    }

    .recipe-ingredients-layout .recipe-ingredients-column {
        order: 2;
    }
}

@media (min-width: 768px) {
    .recipe-ingredients-layout .recipe-image-column {
        order: 2;
    }

    .recipe-ingredients-layout .recipe-ingredients-column {
        order: 1;
    }
}

.shared-ingredient-trigger {
    font-size: 0.95rem;
    line-height: 1.5;
    min-width: 24px;
}

.shared-ingredient-trigger:hover,
.shared-ingredient-trigger:focus {
    color: var(--bs-primary) !important;
}

.shared-ingredient-popover {
    max-width: min(300px, 85vw);
}

/* Board members and invitation popover */
.board-members-list {
    padding-left: 2rem;
}

.add-member-item {
    list-style: none;
    position: relative;
}

.add-member-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: -1.45rem;
    padding: 0;
    border: none;
    background: none;
    color: #6c757d;
    font: inherit;
    cursor: pointer;
}

.add-member-trigger:hover {
    color: #0d6efd;
}

.add-member-trigger .bi {
    font-size: 14px;
    line-height: 1;
}

.board-invite-popover {
    min-width: 240px;
}

/* Collaborative board sticky note */
.board-sticky-note {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: none;
    overflow: hidden;
}

.board-sticky-note:focus-within {
    outline: none;
    box-shadow: none;
}

.board-sticky-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.board-sticky-header .bi-sticky {
    font-size: 1.15rem;
    color: #6c757d;
}

.board-note-status {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

/* Quill adds ql-container and ql-snow to the editor element itself. */
.board-note-editor,
.board-note-editor.ql-container.ql-snow {
    background: #ffffff;
    color: #343a40;
    border: none !important;
    box-shadow: none;
    font-family: inherit;
    font-size: 16px;
}

.board-note-editor .ql-editor {
    min-height: 140px;
    max-height: 400px;
    overflow-y: auto;
    padding: 18px 20px;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.board-note-editor .ql-editor:focus {
    outline: none;
    box-shadow: none;
}

.board-note-editor .ql-editor.ql-blank::before {
    content: "Add a note for your board...";
    color: #adb5bd;
    font-style: normal;
    left: 20px;
    right: 20px;
}

.board-note-editor .ql-editor p {
    margin-bottom: 0.5rem;
}

@media (max-width: 576px) {
    .board-sticky-header {
        padding: 14px 16px;
    }

    .board-note-editor .ql-editor {
        padding: 16px;
        min-height: 120px;
    }
}