/* OldGrub — Old-Fashioned Family Recipe Theme */

:root {
    --og-parchment: #FFF8F0;
    --og-cream: #FDF5E6;
    --og-brown: #3E2723;
    --og-brown-light: #5D4037;
    --og-accent: #BF360C;
    --og-accent-light: #E64A19;
    --og-warm-gray: #8D6E63;
    --og-border: #D7CCC8;
    --og-success: #558B2F;
    --og-warning: #F9A825;
}

/* ===== Typography ===== */
body {
    font-family: 'Lato', sans-serif;
    background-color: var(--og-parchment);
    color: var(--og-brown);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.oldgrub-main {
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.brand-font {
    font-family: 'Playfair Display', serif;
}

.handwriting-font {
    font-family: 'Caveat', cursive;
}

h1, h2, h3, h4, h5 {
    font-family: 'Playfair Display', serif;
    color: var(--og-brown);
}

a {
    color: var(--og-accent);
    text-decoration: none;
}

a:hover {
    color: var(--og-accent-light);
    text-decoration: underline;
}

/* ===== Colors ===== */
.bg-brown {
    background-color: var(--og-brown) !important;
}

.text-brown {
    color: var(--og-brown) !important;
}

.text-accent {
    color: var(--og-accent) !important;
}

/* ===== Navbar ===== */
.navbar-dark.bg-brown {
    box-shadow: 0 2px 8px rgba(62, 39, 35, 0.3);
}

.navbar-dark.bg-brown .navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.navbar-dark.bg-brown .nav-link {
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.2s;
}

.navbar-dark.bg-brown .nav-link:hover {
    color: #fff;
}

.oldgrub-family-strip {
    background: linear-gradient(180deg, rgba(255, 248, 240, 0.98) 0%, rgba(253, 245, 230, 0.96) 100%);
    border-bottom: 1px solid rgba(141, 110, 99, 0.18);
    box-shadow: 0 6px 18px rgba(62, 39, 35, 0.07);
}

.oldgrub-family-strip-inner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
}

.oldgrub-family-strip-label {
    color: var(--og-brown-light);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex: 0 0 auto;
}

.oldgrub-family-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.46rem 0.88rem;
    border-radius: 999px;
    border: 1px solid rgba(141, 110, 99, 0.24);
    background: rgba(255, 255, 255, 0.76);
    color: var(--og-brown);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(62, 39, 35, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    flex: 0 0 auto;
}

.oldgrub-family-chip:hover {
    color: var(--og-accent);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(62, 39, 35, 0.12);
}

.oldgrub-family-chip.active {
    background: var(--og-accent);
    border-color: var(--og-accent);
    color: #fff;
}

.oldgrub-family-chip.active:hover {
    color: #fff;
}

.oldgrub-family-chip-create {
    background: rgba(191, 54, 12, 0.1);
    border-color: rgba(191, 54, 12, 0.24);
    color: var(--og-accent);
}

.oldgrub-family-chip-create:hover {
    color: var(--og-accent-light);
}

@media (max-width: 767.98px) {
    .oldgrub-family-strip-inner {
        padding: 0.6rem 0;
        gap: 0.45rem;
    }

    .oldgrub-family-chip {
        font-size: 0.86rem;
        padding: 0.42rem 0.72rem;
    }
}

.navbar .form-control {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.navbar .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.navbar .form-control:focus {
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ===== Buttons ===== */
.btn-primary {
    background-color: var(--og-accent);
    border-color: var(--og-accent);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--og-accent-light);
    border-color: var(--og-accent-light);
}

.btn-outline-primary {
    color: var(--og-accent);
    border-color: var(--og-accent);
}

.btn-outline-primary:hover {
    background-color: var(--og-accent);
    border-color: var(--og-accent);
    color: #fff;
}

/* ===== Cards — recipe index card style ===== */
.recipe-card {
    background-color: var(--og-cream);
    border: 1px solid var(--og-border);
    border-radius: 6px;
    box-shadow: 2px 3px 8px rgba(62, 39, 35, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.recipe-card:hover {
    transform: translateY(-3px);
    box-shadow: 3px 6px 16px rgba(62, 39, 35, 0.15);
}

.recipe-card .card-title a {
    color: var(--og-brown);
    text-decoration: none;
}

.recipe-card .card-title a:hover {
    color: var(--og-accent);
    text-decoration: none;
}

.recipe-card .card-img-top {
    border-radius: 6px 6px 0 0;
}

.clickable-card {
    cursor: pointer;
}


.ingredient-scale-controls {
    min-width: min(100%, 280px);
}

.ingredient-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--og-warm-gray);
    border-bottom-color: rgba(141, 110, 99, 0.2);
}

.ingredient-table td {
    background: transparent;
    border-bottom-color: rgba(141, 110, 99, 0.12);
}

.recipe-version-summary {
    background-color: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-radius: 8px;
    padding: 0.72rem 0.82rem;
}

.recipe-compare-card {
    height: 100%;
}

.recipe-compare-card-ai {
    border-color: rgba(76, 110, 245, 0.18);
    box-shadow: 0 16px 30px rgba(76, 110, 245, 0.08);
}

.recipe-compare-card-special {
    border-color: rgba(191, 54, 12, 0.22);
    box-shadow: 0 18px 34px rgba(191, 54, 12, 0.1);
}

.recipe-compare-card-original {
    border-color: rgba(141, 110, 99, 0.18);
}

.recipe-compare-badge {
    white-space: nowrap;
}

.recipe-compare-section + .recipe-compare-section {
    margin-top: 1.25rem;
}

.recipe-compare-section-title {
    color: var(--og-brown);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.recipe-compare-notes {
    background-color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(141, 110, 99, 0.12);
    border-radius: 8px;
    padding: 0.9rem 1rem;
}

.voice-note-item {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-radius: 10px;
    padding: 0.8rem 0.9rem;
}

.recipe-ai-variant-panel {
    border-color: rgba(141, 110, 99, 0.18) !important;
}

.recipe-ai-variant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.55rem;
}

.recipe-ai-variant-btn {
    min-height: 100%;
    text-align: left;
    padding: 0.72rem 0.82rem;
}

.recipe-ai-variant-label {
    display: block;
    font-weight: 700;
}

.recipe-ai-variant-btn small {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.74rem;
}

/* ===== Badge styling ===== */
.badge.bg-light {
    border: 1px solid var(--og-border) !important;
}

/* ===== Star rating ===== */
.star-rating .star-btn {
    font-size: 1.3rem;
    transition: transform 0.15s ease;
    margin-right: 2px;
}

.star-rating .star-btn:hover {
    transform: scale(1.2);
}

/* ===== Comments ===== */
.comment-item .card {
    background-color: #fff;
    border: 1px solid var(--og-border);
    border-radius: 6px;
}

.comment-item .reply-btn {
    transition: color 0.2s;
}

.comment-item .reply-btn:hover {
    color: var(--og-accent) !important;
}

/* ===== Recipe photos ===== */
.recipe-photo-stage {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(215, 204, 200, 0.35));
    border: 1px solid rgba(141, 110, 99, 0.2);
}

.recipe-photo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
}

.recipe-photo-open {
    width: 100%;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: transparent;
    border: 0;
    cursor: zoom-in;
}

.recipe-detail-photo {
    width: 100%;
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px rgba(62, 39, 35, 0.12);
}

.recipe-photo-toolbar {
    border-top: 1px solid rgba(141, 110, 99, 0.2);
    padding-top: 0.9rem;
}

.recipe-detail-compact-panel .card-body {
    padding: 0.95rem 1rem;
}

.recipe-compact-rating {
    height: 100%;
    padding: 0.75rem 0.85rem;
    background-color: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(141, 110, 99, 0.14);
    border-radius: 10px;
}

.recipe-compact-star-rating .star-btn {
    font-size: 1rem;
    margin-right: 0;
}

.recipe-memory-compact-list {
    display: grid;
    gap: 0.55rem;
}

.recipe-memory-compact-item {
    padding: 0.7rem 0.8rem;
    background-color: rgba(255, 248, 240, 0.82);
    border: 1px solid rgba(141, 110, 99, 0.14);
    border-radius: 10px;
}

.recipe-memory-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.recipe-memory-compact-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background-color: rgba(191, 54, 12, 0.12);
    color: var(--og-accent);
    font-size: 0.78rem;
    font-weight: 700;
}

.recipe-memory-compact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem 1rem;
}

.recipe-memory-compact-full {
    grid-column: 1 / -1;
}

.recipe-memory-compact-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--og-warm-gray);
    margin-bottom: 0.12rem;
}

.recipe-memory-empty-state-compact {
    padding: 0.75rem 0.85rem;
}

.recipe-memory-compact-form {
    padding-top: 0.3rem;
    border-top: 1px solid rgba(141, 110, 99, 0.12);
}

.recipe-memory-compact-actions {
    display: flex;
    justify-content: flex-end;
}

.recipe-photo-secondary-tools,
.recipe-inline-voice-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.85rem;
}

.recipe-inline-voice-controls {
    padding: 0.85rem 1rem;
    background-color: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-radius: 12px;
}

.recipe-voice-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: 999px;
    padding: 0.38rem 0.85rem 0.38rem 0.45rem;
}

.recipe-voice-chip-icon {
    width: 1.9rem;
    height: 1.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(191, 54, 12, 0.12);
    color: var(--og-accent);
    flex-shrink: 0;
}

.recipe-voice-chip-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--og-brown);
    white-space: nowrap;
}

.recipe-voice-notes-modal {
    background-color: var(--og-cream);
    border-color: var(--og-border);
}

.voice-note-list {
    display: grid;
    gap: 0.85rem;
}

.recipe-photo-item-actions {
    border-top: 1px solid rgba(141, 110, 99, 0.14);
    margin-top: 0.25rem;
}

.recipe-admin-panel .card-body,
.cookbook-danger-zone .card-body {
    padding: 1rem 1.1rem;
}

.recipe-admin-danger-panel,
.cookbook-danger-zone {
    background: linear-gradient(180deg, rgba(255, 239, 239, 0.92), rgba(255, 246, 246, 0.98));
}

.recipe-admin-danger-panel {
    height: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(176, 0, 32, 0.18);
    border-radius: 10px;
}

.landing-invitation-card {
    border-color: rgba(255, 152, 0, 0.28) !important;
    box-shadow: 0 14px 28px rgba(191, 54, 12, 0.08);
}

.recipe-version-card .card-body {
    padding: 0.95rem 1rem;
}

.recipe-version-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.recipe-version-toolbar .btn {
    align-self: flex-start;
}

.recipe-ai-usage-badge {
    padding: 0.4rem 0.65rem !important;
}

@media (max-width: 767.98px) {
    .recipe-memory-compact-grid {
        grid-template-columns: 1fr;
    }

    .recipe-memory-compact-actions {
        justify-content: stretch;
    }

    .recipe-memory-compact-actions .btn {
        width: 100%;
    }
}

#recipePhotoCaption:empty,
#recipePhotoModalCaption:empty {
    display: none;
}

.recipe-photo-modal .modal-content {
    background-color: var(--og-cream);
    border-color: var(--og-border);
}

.recipe-photo-modal-frame {
    min-height: min(75vh, 760px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255, 248, 240, 0.92), rgba(215, 204, 200, 0.4));
    border: 1px solid rgba(141, 110, 99, 0.18);
    border-radius: 10px;
    padding: 1rem;
    overflow: hidden;
}

.recipe-photo-modal-image {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.15s ease-out;
    cursor: zoom-in;
    touch-action: none;
}

.recipe-photo-modal-image.zoomed-in {
    cursor: grab;
}

.rescan-photo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    max-height: 60vh;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 248, 240, 0.92), rgba(215, 204, 200, 0.4));
    border-radius: 8px;
}

.rescan-photo-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.15s ease-out;
    cursor: zoom-in;
    touch-action: none;
}

.recipe-photo-picker {
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-radius: 12px;
}

.recipe-photo-selected-list {
    display: grid;
    gap: 0.75rem;
}

.recipe-photo-selected-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    background-color: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-radius: 10px;
}

.recipe-photo-selected-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(62, 39, 35, 0.1);
}

.recipe-photo-selected-meta {
    min-width: 0;
}

.recipe-memory-editor {
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-radius: 12px;
}

.recipe-memory-rows {
    display: grid;
    gap: 0.9rem;
}

.recipe-memory-row {
    padding: 0.95rem 1rem;
    background-color: rgba(255, 248, 240, 0.82);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-radius: 12px;
}

.recipe-memory-row-title {
    color: var(--og-brown);
}

.recipe-memory-table th {
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--og-warm-gray);
    white-space: nowrap;
}

.recipe-memory-table td,
.recipe-memory-table th {
    background: transparent;
    border-bottom-color: rgba(141, 110, 99, 0.14);
    vertical-align: top;
}

.recipe-memory-table-index {
    width: 3rem;
    text-align: center;
    color: var(--og-warm-gray);
}

.recipe-memory-empty-state {
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.58);
    border: 1px dashed rgba(141, 110, 99, 0.24);
    border-radius: 10px;
    color: var(--og-warm-gray);
}

/* ===== Scan processing ===== */
.recipe-processing-panel {
    background: linear-gradient(180deg, rgba(255, 248, 240, 0.95), rgba(253, 245, 230, 0.98));
    border: 1px solid var(--og-border);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    padding: 1rem;
}

.recipe-processing-list {
    display: grid;
    gap: 0.5rem;
}

.recipe-processing-stage-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 0.45rem;
}

.recipe-processing-stage-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(141, 110, 99, 0.16);
    color: var(--og-warm-gray);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.recipe-processing-stage-item.active {
    background-color: rgba(191, 54, 12, 0.12);
    border-color: rgba(191, 54, 12, 0.28);
    color: var(--og-accent);
}

.recipe-processing-stage-item.done {
    background-color: rgba(85, 139, 47, 0.12);
    border-color: rgba(85, 139, 47, 0.22);
    color: var(--og-success);
}

.recipe-processing-file {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.recipe-processing-file.active {
    border-color: rgba(191, 54, 12, 0.45);
    box-shadow: 0 8px 18px rgba(62, 39, 35, 0.08);
    transform: translateY(-1px);
}

.recipe-processing-file.done {
    background-color: rgba(255, 255, 255, 0.92);
    border-color: rgba(85, 139, 47, 0.2);
}

.recipe-processing-file.done .recipe-processing-file-index {
    background-color: rgba(85, 139, 47, 0.14);
    color: var(--og-success);
}

.recipe-processing-file-index {
    width: 1.8rem;
    height: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background-color: rgba(191, 54, 12, 0.12);
    color: var(--og-accent);
    font-weight: 700;
    font-size: 0.8rem;
}

.recipe-processing-file-name {
    color: var(--og-brown);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recipe-processing-file-status {
    color: var(--og-warm-gray);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ===== Cookbook chatbot ===== */
.oldgrub-chatbot {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.oldgrub-chatbot-launcher {
    border-radius: 999px;
    box-shadow: 0 14px 28px rgba(62, 39, 35, 0.18);
    font-size: 0.92rem;
    line-height: 1.2;
    max-width: min(100%, 16.5rem);
    padding: 0.65rem 0.95rem;
    text-align: left;
    white-space: normal;
    animation: foodie-pulse 2.5s ease-in-out infinite;
}

@keyframes foodie-pulse {
    0%, 100% { box-shadow: 0 14px 28px rgba(62, 39, 35, 0.18); }
    50%      { box-shadow: 0 14px 28px rgba(62, 39, 35, 0.18), 0 0 18px 4px rgba(230, 74, 25, 0.35); }
}

.oldgrub-chatbot-panel {
    width: min(430px, calc(100vw - 2rem));
    height: min(44rem, calc(100vh - 2rem));
    max-height: min(44rem, calc(100dvh - 2rem));
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(230, 74, 25, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255, 248, 240, 0.99), rgba(250, 238, 223, 0.98));
    border: 1px solid rgba(141, 110, 99, 0.24);
    border-radius: 22px;
    box-shadow: 0 28px 56px rgba(62, 39, 35, 0.22);
    overflow: hidden;
}

.oldgrub-chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.15rem 1rem;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(62, 39, 35, 0.98), rgba(93, 64, 55, 0.96)),
        linear-gradient(90deg, rgba(191, 54, 12, 0.2), rgba(230, 74, 25, 0.12));
}

.oldgrub-chatbot-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 248, 240, 0.72);
    margin-bottom: 0.35rem;
}

.oldgrub-chatbot-header h2 {
    color: #fff;
}

.oldgrub-chatbot-header p {
    color: rgba(255, 248, 240, 0.82);
}

.oldgrub-chatbot-close {
    color: rgba(255, 248, 240, 0.76);
    font-size: 1.1rem;
    min-width: 2rem;
    min-height: 2rem;
}

.oldgrub-chatbot-close:hover {
    color: #fff;
}

.oldgrub-chatbot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.oldgrub-chatbot-toolbar {
    padding: 1rem 1rem 0.75rem;
}

.oldgrub-chatbot-toolbar > div {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-radius: 14px;
    padding: 0.85rem 0.9rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.oldgrub-chatbot-alert {
    margin: 0 1rem 0.75rem;
}

.oldgrub-chatbot-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 248, 240, 0)),
        repeating-linear-gradient(
            180deg,
            rgba(141, 110, 99, 0.03) 0,
            rgba(141, 110, 99, 0.03) 1px,
            transparent 1px,
            transparent 34px
        );
}

.oldgrub-chatbot-message {
    display: flex;
}

.oldgrub-chatbot-message-user {
    justify-content: flex-end;
}

.oldgrub-chatbot-message-assistant {
    justify-content: flex-start;
}

.oldgrub-chatbot-message-body {
    max-width: 88%;
    padding: 0.85rem 0.95rem;
    border-radius: 18px;
    line-height: 1.45;
    box-shadow: 0 10px 22px rgba(62, 39, 35, 0.08);
}

.oldgrub-chatbot-sources {
    margin-top: 0.85rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(141, 110, 99, 0.18);
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.oldgrub-chatbot-sources-label {
    flex-basis: 100%;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--og-warm-gray);
}

.oldgrub-chatbot-source-link {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background-color: rgba(191, 54, 12, 0.08);
    border: 1px solid rgba(191, 54, 12, 0.14);
    font-size: 0.82rem;
    line-height: 1.25;
}

.oldgrub-chatbot-message-user .oldgrub-chatbot-message-body {
    background: linear-gradient(135deg, var(--og-accent), var(--og-accent-light));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.oldgrub-chatbot-message-assistant .oldgrub-chatbot-message-body {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(141, 110, 99, 0.16);
    border-bottom-left-radius: 4px;
}

.oldgrub-chatbot-form {
    padding: 0 1rem 1rem;
    border-top: 1px solid rgba(141, 110, 99, 0.12);
    flex-shrink: 0;
}

.oldgrub-chatbot-form textarea {
    resize: vertical;
    min-height: 74px;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.82);
}

.oldgrub-chatbot-send {
    min-width: 96px;
    border-radius: 999px;
}

.oldgrub-chatbot-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem 1rem;
    border-top: 1px solid rgba(141, 110, 99, 0.16);
    background-color: rgba(255, 255, 255, 0.58);
    flex-shrink: 0;
}

.oldgrub-chatbot-credit-block {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.oldgrub-chatbot-footer-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--og-warm-gray);
}

.oldgrub-chatbot-usage {
    font-weight: 700;
    color: var(--og-brown);
}

.oldgrub-page-quote {
    max-width: min(100%, 44rem);
    margin: 0.35rem auto 1rem;
    padding: 0.55rem 0.85rem 0.65rem;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(253, 245, 230, 0.8));
    border-top: 1px solid rgba(191, 54, 12, 0.22);
    border-bottom: 1px solid rgba(141, 110, 99, 0.2);
    box-shadow: 0 10px 24px rgba(62, 39, 35, 0.05);
}

.oldgrub-page-quote-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(0.84rem, 0.78rem + 0.25vw, 0.98rem);
    line-height: 1.42;
    color: var(--og-brown);
}

.oldgrub-page-quote-attribution {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--og-warm-gray);
}

/* ===== Forms ===== */
.form-control:focus, .form-select:focus {
    border-color: var(--og-accent);
    box-shadow: 0 0 0 0.2rem rgba(191, 54, 12, 0.2);
}

.form-label {
    font-weight: 600;
    color: var(--og-brown-light);
}

/* ===== Alerts ===== */
.alert {
    border-radius: 6px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #f1f8e9;
    border-color: var(--og-success);
    color: #33691E;
}

.alert-warning {
    background-color: #FFF8E1;
    border-color: var(--og-warning);
    color: #F57F17;
}

.alert-danger {
    background-color: #FFEBEE;
    border-color: #C62828;
    color: #B71C1C;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--og-warm-gray);
}

.breadcrumb-item.active {
    color: var(--og-brown);
}

/* ===== Footer ===== */
.footer {
    margin-top: auto;
    border-top: 3px solid var(--og-accent);
}

.footer .brand-font {
    font-size: 1.2rem;
    letter-spacing: 0.05em;
}

/* ===== Landing page ===== */
.hero-section {
    background: linear-gradient(135deg, var(--og-cream) 0%, var(--og-parchment) 100%);
    border-bottom: 2px solid var(--og-border);
}

.landing-page {
    display: grid;
    gap: 0.9rem;
}

.landing-hero-card {
    background:
        radial-gradient(circle at top right, rgba(230, 74, 25, 0.11), transparent 34%),
        linear-gradient(135deg, rgba(253, 245, 230, 0.98), rgba(255, 248, 240, 0.96));
}

.landing-hero-body {
    padding: 1.4rem 1.5rem;
}

.landing-kicker {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--og-warm-gray);
}

.landing-title {
    font-size: clamp(2.2rem, 1.9rem + 1.2vw, 3.2rem);
    line-height: 1.02;
}

.landing-copy {
    font-size: 1rem;
    line-height: 1.55;
    max-width: 34rem;
}

.homepage-header-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.homepage-header-copy {
    flex: 1 1 18rem;
    min-width: 0;
}

.homepage-header-media {
    width: clamp(8.25rem, 21vw, 12rem);
    aspect-ratio: 1;
    padding: 0.4rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(253, 245, 230, 0.94));
    border: 1px solid rgba(141, 110, 99, 0.18);
    border-radius: 20px;
    box-shadow: 0 14px 28px rgba(62, 39, 35, 0.12);
}

.homepage-header-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 16px;
}

.landing-carousel {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(78, 52, 46, 0.13);
    border: 1px solid rgba(141, 110, 99, 0.16);
}

.landing-carousel-img {
    border-radius: 14px 14px 0 0;
    object-fit: cover;
    max-height: 340px;
}

.landing-carousel-caption {
    position: relative;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--og-cream) 0%, #fff9f0 100%);
    padding: 1.15rem 1.1rem;
    margin-top: 0.5em;
    border-radius: 0 0 14px 14px;
    text-align: center;
}

.landing-carousel-caption p {
    margin: 0;
    color: var(--og-brown);
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.landing-carousel {
    margin-bottom: 0.5em;
}

.landing-carousel .carousel-indicators {
    bottom: auto;
    top: 0.6rem;
    margin-bottom: 0;
}

.landing-carousel .carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(78, 52, 46, 0.3);
    opacity: 0.6;
}

.landing-carousel .carousel-indicators .active {
    background-color: var(--og-brown, #5D4037);
    opacity: 1;
}

.landing-carousel .carousel-control-prev-icon,
.landing-carousel .carousel-control-next-icon {
    background-color: rgba(78, 52, 46, 0.45);
    border-radius: 50%;
    padding: 0.6rem;
    background-size: 55%;
}

.landing-carousel .carousel-item {
    transition: transform 0.6s ease-in-out;
}

.landing-feature-card .card-body {
    padding: 1.05rem 1.1rem;
}

.landing-feature-icon {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    border-radius: 999px;
    background-color: rgba(191, 54, 12, 0.1);
    font-size: 1rem;
}

/* ===== Pagination ===== */
.page-link {
    color: var(--og-accent);
    border-color: var(--og-border);
}

.page-item.active .page-link {
    background-color: var(--og-accent);
    border-color: var(--og-accent);
}

.page-link:hover {
    color: var(--og-accent-light);
    background-color: var(--og-cream);
}

/* ===== Search results ===== */
.search-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

/* ===== Family detail ===== */
.member-card {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid var(--og-border);
    padding: 12px;
    transition: box-shadow 0.2s;
}

.member-card:hover {
    box-shadow: 0 2px 8px rgba(62, 39, 35, 0.1);
}

.family-detail-page {
    display: grid;
    gap: 0.95rem;
}

.family-summary-card {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(253, 245, 230, 0.94)),
        radial-gradient(circle at top right, rgba(230, 74, 25, 0.08), transparent 34%);
}

.family-description {
    max-width: 48rem;
}

.family-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.family-section-card .card-body {
    min-height: 100%;
}

.family-inline-action {
    white-space: nowrap;
}

.family-cookbook-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.family-member-list,
.family-invite-list {
    display: grid;
    gap: 0.75rem;
}

.family-member-row,
.family-invite-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(141, 110, 99, 0.14);
    border-radius: 10px;
}

.family-member-meta,
.family-invite-row > div {
    min-width: 0;
}

.family-member-meta strong {
    color: var(--og-brown);
}

.family-empty-state {
    padding: 0.95rem 1rem;
    background-color: rgba(255, 255, 255, 0.55);
    border: 1px dashed rgba(141, 110, 99, 0.24);
    border-radius: 10px;
}

/* ===== Dropdown ===== */
.dropdown-menu {
    border-color: var(--og-border);
    box-shadow: 0 4px 12px rgba(62, 39, 35, 0.15);
}

.dropdown-item:hover {
    background-color: var(--og-cream);
    color: var(--og-brown);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .display-3 {
        font-size: 2rem;
    }

    .oldgrub-main {
        margin-top: 0.85rem;
        margin-bottom: 1.2rem;
    }

    .recipe-card:hover {
        transform: none; /* Disable hover lift on mobile */
    }

    .navbar-brand {
        font-size: 1.2rem !important;
    }

    .d-flex.gap-3 {
        gap: 0.5rem !important;
    }

    .recipe-photo-frame,
    .recipe-photo-open {
        min-height: 300px;
    }

    .recipe-detail-photo {
        max-height: 300px;
    }

    .oldgrub-chatbot {
        right: max(0.75rem, env(safe-area-inset-right));
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        left: max(0.75rem, env(safe-area-inset-left));
        align-items: stretch;
    }

    .oldgrub-chatbot-launcher {
        align-self: flex-end;
    }

    .oldgrub-chatbot-panel {
        width: 100%;
        height: min(31rem, calc(100vh - 7rem));
        max-height: min(31rem, calc(100dvh - 7rem));
        border-radius: 18px;
    }

    .oldgrub-chatbot-header {
        padding: 0.75rem 1rem 0.65rem;
    }

    .oldgrub-chatbot-toolbar {
        padding: 0.6rem 0.75rem 0.4rem;
    }

    .oldgrub-chatbot-toolbar > div {
        padding: 0.55rem 0.75rem;
    }

    .oldgrub-chatbot-form {
        padding: 0 0.75rem 0.5rem;
    }

    .oldgrub-chatbot-form textarea {
        min-height: 48px;
    }

    .oldgrub-chatbot-footer {
        flex-direction: row;
        align-items: center;
        padding: 0.4rem 0.75rem;
        font-size: 0.78rem;
        gap: 0.5rem;
    }

    .oldgrub-chatbot-footer .oldgrub-chatbot-footer-label {
        font-size: 0.65rem;
    }

    .oldgrub-chatbot-footer .oldgrub-chatbot-credit-block {
        gap: 0;
    }

    .oldgrub-chatbot-footer .text-muted {
        white-space: nowrap;
        font-size: 0.7rem;
    }

    .landing-hero-body {
        padding: 1.1rem 1rem;
    }

    .landing-copy {
        font-size: 0.95rem;
        max-width: none;
    }

    .homepage-header-row {
        justify-content: center;
        text-align: center;
    }

    .family-action-group {
        width: 100%;
    }

    .family-action-group .btn {
        flex: 1 1 auto;
    }

    .family-member-row,
    .family-invite-row {
        padding: 0.7rem 0.75rem;
    }

    .recipe-photo-secondary-tools,
    .recipe-inline-voice-controls {
        gap: 0.5rem;
    }

    .recipe-voice-chip-text {
        white-space: normal;
    }

    .recipe-photo-selected-item {
        grid-template-columns: 56px 1fr;
    }

    .recipe-photo-selected-thumb {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .badge.p-2 {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem !important;
    }

    .landing-carousel-img {
        max-height: 240px;
    }

    .landing-carousel-caption p {
        font-size: 0.88rem;
    }

    .homepage-header-media {
        width: 7.5rem;
    }

    .oldgrub-page-quote {
        padding: 0.5rem 0.75rem 0.55rem;
    }

    .family-member-row,
    .family-invite-row {
        flex-wrap: wrap;
    }
}
