
* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

html {
    background: #111;
    transition:
        background 0.35s ease,
        color 0.25s ease;
}

body {
    height: 100%;
    font-family: var(--font-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.45;
background:
    var(--bg-main-overlay, transparent),
    var(--bg-main-image, none),
    var(--bg-main);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
}

/* =========================================================
   Typography
   ========================================================= */

h1,
h2,
h3 {
    margin-top: 0;
    color: var(--text-heading);
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
}

h1 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    margin-bottom: 0.4rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

a {
    color: var(--accent-link);
    text-decoration: none;
    transition: color 0.18s ease, opacity 0.18s ease;
}

a:hover {
    color: var(--text-link-hover);
    text-decoration: none;
}

p {
    color: var(--text-soft);
}

/* Basics */
.hidden {
    opacity: 0;
    pointer-events: none;
}

.shown {
    opacity: 1;
    pointer-events: default;
}

/* =========================================================
   Optional page wrapper
   Add a container around content if you want:
   <main class="page-shell"> ... </main>
   ========================================================= */
span.smaller {
    font-size: 0.8rem;
}

.page-shell {
    margin-left: 180px;

    padding: 20px;
    width: calc(100vw - 180px);
    max-width: calc(100vw - 190px);

    box-sizing: border-box;
    opacity: 0;

background: var(--bg-shell);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 24px;
    backdrop-filter: blur(4px);

    transition: opacity 1s ease;
 
    height: auto;
}

/* =========================================================
   Status / helper blocks
   ========================================================= */

.loading,
.error,
.empty {
    padding: 16px 18px;
    background: var(--bg-panel);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-md);
    color: var(--text-soft);
    box-shadow: var(--shadow-soft);
}

.error {
    border-color: rgba(214, 107, 107, 0.40);
    color: #ffd5d5;
}

/* =========================================================
   Category Layout
   ========================================================= */

#category-list {
    margin-top: 20px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    background: var(--bg-category-card);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    border-color: rgba(201, 162, 111, 0.35);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.category-card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.category-card-media {
    position: absolute;
    inset: 0;
}

.category-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out, transform 6s ease;
    transform: scale(1.03);
}

.category-card-bg.is-visible {
    opacity: 1;
    transform: scale(1.07);
}

.category-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.10) 100%);
    pointer-events: none;
}

.category-card-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.category-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-heading);
    margin: 0;
    overflow-wrap: anywhere;
}

.category-count {
    flex-shrink: 0;
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(231, 212, 190, 0.82);
    white-space: nowrap;
}
/* =========================================================
   Recipe Cards
   ========================================================= */

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.recipe-card {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: var(--bg-card)
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}


.recipe-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-deep), var(--glow-moss);
    background: var(--bg-card-hover)
}


.recipe-card:hover .recipe-card-image img {
    transform: scale(1.04);
}

.recipe-list-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recipe-list-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
}

.recipe-list-title-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-list-favorite-icon {
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1;
    color: #f0c35a;
}

.recipe-list-share-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: inline-block;
}
.recipe-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-moss), var(--accent-ember));
    opacity: 0.75;
}

.recipe-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-deep), var(--glow-moss);
    background:
        linear-gradient(180deg, rgba(66, 54, 46, 0.98), rgba(38, 31, 27, 1));
}

.recipe-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-heading);
    margin-bottom: 0.35rem;
}

.recipe-description {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.recipe-meta {
    color: var(--text-muted);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap; /* optional: allows wrap on small screens */
}


/* =========================================================
   Modal Shell
   ========================================================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 2rem 1rem;
    overflow-y: auto;
    background: var(--bg-overlay-modal);
    backdrop-filter: blur(6px);
}

.modal-content {
    position: relative;
    width: min(1100px, 92vw);
    margin: 0 auto;
    background: var(--bg-panel);
    border: 1px solid var(--border-mid);
    border-radius: 18px;
    padding: 1.35rem 1.35rem 1.5rem;
    box-sizing: border-box;
    box-shadow:
        0 18px 60px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 26px rgba(136, 185, 138, 0.08);
}

.recipe-modal-content,
.import-recipe-modal-content {
    width: min(1100px, 92vw);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-soft);
}

.modal-header h2,
#recipeModalTitle {
    margin: 0;
}

.modal-close {
    cursor: pointer;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--text-soft);
    transition: transform 0.18s ease, color 0.18s ease;
}

.modal-close:hover {
    color: #ffd0d0;
    transform: scale(1.15);
}

.recipe-modal-body {
    padding: 0.5rem 0 0;
}

/* =========================================================
   Recipe Form
   ========================================================= */

.recipe-form-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-soft);
}

.recipe-form-section:first-child {
    margin-top: 0.5rem;
}

.recipe-form-section h3,
.recipe-form-section h4 {
    margin-bottom: 0.85rem;
    color: var(--text-heading);
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group.checkbox-group {
    justify-content: flex-end;
}

.form-group label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

#share_recipe_link,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(220, 205, 187, 0.14);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-main);
    box-sizing: border-box;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #8f837a;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(220, 205, 187, 0.24);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(168, 216, 163, 0.55);
    box-shadow: 0 0 0 3px rgba(136, 185, 138, 0.16);
    background: rgba(26, 21, 19, 0.95);
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
}

.form-group select[multiple] {
    min-height: 140px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.form-group input[type="checkbox"] {
    width: auto;
    min-width: 18px;
    min-height: 18px;
    accent-color: var(--accent-moss);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
}

.field-help {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.section-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* =========================================================
   Buttons
   ========================================================= */

button,
.button,
.modal-actions button,
.section-header-inline button {
    appearance: none;
    border: 1px solid var(--button-border);
    border-radius: 10px;
    padding: 0.52rem .5rem;
    background: var(--button-bg);
    color: var(--button-text);
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--button-shadow);
    transition:
        transform 0.16s ease-in-out,
        filter 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease,
        color 0.16s ease;
}

button:hover,
.button:hover,
.modal-actions button:hover,
.section-header-inline button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: var(--button-shadow-hover), var(--button-bg-hover-glow);
    background: var(--button-bg-hover-bg);
}

button:active,
.button:active {
    transform: translateY(0);
}

button.secondary,
.button.secondary {
    background: var(--button-secondary-bg);
    border-color: var(--button-secondary-border);
    color: var(--button-secondary-text);
}

button:active,
.button:active {
    transform: translateY(0);
}

.button-danger {
    background: transparent;
    border: 1px solid rgba(214, 107, 107, 0.45);
    color: var(--accent-danger);

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.button-danger:hover {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: #ffffff;

    box-shadow: 0 0 8px rgba(214, 107, 107, 0.35);
}

button.secondary,
.button.secondary {
    background:
        linear-gradient(180deg, rgba(96, 77, 60, 0.96), rgba(66, 51, 40, 0.96));
    border-color: rgba(215, 167, 107, 0.22);
    color: #fff1df;
}

button:disabled,
.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.modal-actions {
    position: sticky;
    bottom: 0;

    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;

    margin-top: 2rem;
    padding-top: 1rem;

    border-top: 1px solid var(--border-soft);
    z-index: 5;
}

#saveRecipeButton.changed {
    animation: savePulse 1.8s infinite;
}

@keyframes savePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--accent-moss-rgb), 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--accent-moss-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--accent-moss-rgb), 0);
    }
}

#saveRecipeButton.changed {
    animation: savePulse 1.8s infinite;
}
/* =========================================================
   Existing Images Area
   ========================================================= */

.existing-images-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.existing-image-item {
    background: rgba(20, 17, 16, 0.38);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.existing-image-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--glow-moss);
    transform: translateY(-1px);
}

.existing-image-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    background: var(--bg-thumb);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.existing-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.primary-image-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--text-pill);
    color: #d8f0d5;
    border: 1px solid rgba(168, 216, 163, 0.18);
}

/* =========================================================
   Scrollbars
   ========================================================= */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track); 
}

::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb);
    border-radius: 999px;
background: var(--scrollbar-thumb);
}

::-webkit-scrollbar-thumb:hover {
 border: 2px solid var(--scrollbar-track);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 800px) {
    body {
        padding: 14px;
    }

    .recipe-form-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 1rem 0.5rem;
    }

    .modal-content,
    .recipe-modal-content,
    .import-recipe-modal-content {
        width: min(100%, 96vw);
        padding: 1rem;
        border-radius: 14px;
    }

    .modal-actions {
        justify-content: stretch;
    }

    .modal-actions button,
    .modal-actions .button {
        width: 100%;
    }
}

.category-card-content {
    position: relative;
    z-index: 1;
    padding: 16px;
}

.category-card h3,
.category-card p {
    position: relative;
    z-index: 1;
    margin: 0;
}

.category-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.category-card p {
    color: rgba(255, 255, 255, 0.82);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}


/* Sidebar Search */
.sidebar-search-wrap {
    position: relative;
    margin-bottom: 18px;
    overflow: visible;
}

.sidebar-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 32rem;
    max-width: calc(100vw - 32px);
    z-index: 10000;
}

.sidebar-search-results.hidden {
    display: none;
}

.sidebar-search-form {
    margin: 0;
}

.sidebar-search-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(214, 188, 141, 0.22);
    background: rgba(29, 24, 22, 0.92);
    color: var(--text-main);
    font: inherit;
    outline: none;
}

.sidebar-search-input:focus {
    border-color: rgba(214, 188, 141, 0.45);
    box-shadow: 0 0 0 2px rgba(214, 188, 141, 0.10);
}

.sidebar-search-input::placeholder {
    color: rgba(230, 220, 204, 0.55);
}


.sidebar-search-results-inner {
    background: rgba(20, 17, 16, 0.98);
    border: 1px solid rgba(214, 188, 141, 0.20);
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.sidebar-search-section + .sidebar-search-section {
    border-top: 1px solid rgba(214, 188, 141, 0.10);
}

.sidebar-search-section-title {
    padding: 10px 12px 6px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-search-section-body {
    padding: 0 6px 8px;
}

.sidebar-search-result-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--text-main);
    text-decoration: none;
}

.sidebar-search-result-link:hover {
    background: rgba(104, 132, 94, 0.16);
    text-decoration: none;
}

.sidebar-search-result-title {
    font-weight: 600;
    line-height: 1.25;
}

.sidebar-search-match-text {
    font-size: 0.86rem;
    color: var(--text-muted);
}

.sidebar-search-empty {
    padding: 9px 10px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* Search Page */

.search-results-block {
    margin-top: 24px;
}

.recipe-list {
    display: grid;
    gap: 12px;
}

.recipe-list-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(28, 24, 22, 0.86);
    border: 1px solid rgba(214, 188, 141, 0.14);
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.recipe-list-card:hover {
    transform: translateY(-1px);
    border-color: rgba(214, 188, 141, 0.28);
    background: rgba(34, 29, 27, 0.96);
    text-decoration: none;
}

.recipe-list-title {
    font-weight: 700;
}

.recipe-list-subtext {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.recipe-card-image {
    width: 100%;
    height: 140px;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0;
}

.recipe-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.recipe-card-body {
    padding: 12px 14px 14px;
}

.button-danger,
.recipe-action-button.delete {
    border: 1px solid rgba(255, 170, 170, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    background: linear-gradient(180deg, rgba(130, 54, 54, 0.96), rgba(95, 38, 38, 0.96));
    border-color: rgba(214, 107, 107, 0.32);
    color: #fff1f1;
}

.button-danger:hover,
.recipe-action-button.delete:hover {
    background: rgba(160, 52, 52, 0.96);
    transform: translateY(-1px);
}

/* Tag Editor */
.manage-tags-modal-content {
    width: min(92vw, 760px);
    max-width: 760px;
}

.manage-tags-tabs {
    display: flex;
    gap: 10px;
    margin: 0 0 20px;
    flex-wrap: wrap;
}

.manage-tags-tab {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main, #f3ede2);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    transition: 0.15s ease;
}

.manage-tags-tab:hover {
    background: rgba(255, 255, 255, 0.10);
}

.manage-tags-tab.is-active {
    background: rgba(185, 135, 83, 0.20);
    border-color: rgba(185, 135, 83, 0.50);
}

.manage-tags-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.manage-tags-message {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.manage-tags-message.is-success {
    background: rgba(84, 140, 92, 0.18);
    border: 1px solid rgba(84, 140, 92, 0.35);
}

.manage-tags-message.is-error {
    background: rgba(160, 70, 70, 0.18);
    border: 1px solid rgba(160, 70, 70, 0.35);
}


.manage-tags-input,
.manage-tag-rename-input {
    width: 100%;
    background: rgba(18, 18, 18, 0.55);
    color: var(--text-main, #f3ede2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
}

.manage-tags-add-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.manage-tag-inline-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.manage-tags-empty {
    padding: 16px;
    border-radius: 12px;
    opacity: 0.8;
    font-style: italic;
    background: rgba(255, 255, 255, 0.04);
}

.manage-tags-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    min-height: 120px;
    margin-bottom: 16px;
}

.manage-tag-row {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    min-height: 120px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.manage-tag-name {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    word-break: break-word;
}

.manage-tag-meta {
    font-size: 0.88rem;
    opacity: 0.8;
    margin-top: 4px;
}

.manage-tag-actions,
.manage-tag-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    margin-top: auto;
}

.manage-tag-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(120, 170, 120, 0.35);
    background: linear-gradient(180deg, rgba(92, 132, 92, 0.95), rgba(64, 100, 64, 0.95));
    color: #f5f1e8;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.12s ease, filter 0.12s ease, border-color 0.12s ease;
}

.manage-tag-icon-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.manage-tag-icon-button.delete {
    border-color: rgba(170, 95, 95, 0.35);
    background: linear-gradient(180deg, rgba(132, 76, 76, 0.95), rgba(96, 52, 52, 0.95));
}

#global-status-messages {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(92vw, 520px);
    pointer-events: none;
}

.status-message {
    position: relative;
    pointer-events: auto;
    overflow: hidden;
    border-radius: 14px;
    padding: 14px 44px 14px 16px;

    background: var(--bg-status);
    color: var(--text-main);
    border: 1px solid var(--border-mid);

    box-shadow:
        var(--shadow-deep),
        0 0 0 1px var(--border-faint) inset;

    backdrop-filter: blur(10px);

    opacity: 0;
    transform: translateY(-14px) scale(0.98);

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}
.status-message.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.status-message.is-closing {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
}

.status-message-body {
    font-size: 0.95rem;
    word-wrap: break-word;
    line-height: 1.5;
}

.status-message-close {
    position: absolute;
    top: 6px;
    right: 6px;
width: 32px;
    height: auto;
    cursor: pointer;
    display: inline-block;

    transition:
        transform 0.3s ease,
        filter 0.3s ease;
}

.status-message-close:hover {
    transform: rotate(180deg) scale(1.1);
    animation: redGlow 3.4s ease-in-out infinite;
}

.status-message-close img {
    width: 100%;
    height: auto;
    display: block;
}


.status-message-timer {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
}

.status-message-timer-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #7aa27a 0%, #d6ab6a 100%);
}
  
.status-message.is-paused .status-message-timer-bar {
    filter: brightness(0.9);
}


.recipe-ingredients-list li {
    margin-bottom: 8px;
}

.recipe-ingredients-list li.raw-ingredient {
    opacity: 0.92;
}

.recipe-ingredients-list li.parsed-ingredient {
    opacity: 1;
}

.ingredient-optional {
    font-style: italic;
    opacity: 0.8;
}

.recipe-servings-control {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 14px;
}

.servings-stepper {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.servings-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    font-weight: 600;

    background: rgba(255, 255, 255, 0.08);
    color: inherit;
}

.servings-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.servings-value {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
}

.recipe-source-content {
    display: none;
    margin-top: 10px;
}

.recipe-source.open .recipe-source-content {
    display: block;
}

.source-toggle {
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    opacity: 0.8;
}

.source-toggle:hover {
    opacity: 1;
}


/* =========================
   Meal Plan Modal
========================= */

.meal-plan-modal-content {
    max-width: 720px;
    display: flex;
    flex-direction: column;
}

.meal-plan-header-actions {
    margin-left: auto;
    margin-right: 36px; /* keeps it clear of the X button */
    display: flex;
    align-items: center;
    gap: 10px;
}

.meal-plan-footer-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
    margin-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.meal-plan-body {
    padding: 10px 0;
}

.meal-plan-empty {
    text-align: center;
    padding: 30px;
    opacity: 0.6;
    font-style: italic;
}

/* =========================
   Meal Plan List
========================= */

.meal-plan-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* =========================
   Meal Item
========================= */

.meal-plan-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px;
    border-radius: 8px;

    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);

    cursor: pointer;
    transition: background 0.15s ease;
}

.meal-plan-item:hover {
    background: rgba(255,255,255,0.07);
}

/* =========================
   Drag Handle
========================= */

.meal-plan-drag-handle {
    cursor: grab;
    opacity: 0.6;
    padding: 4px;
}

.meal-plan-drag-handle:hover {
    opacity: 1;
}

.meal-plan-drag-handle:active {
    cursor: grabbing;
}

/* =========================
   Thumbnail
========================= */

.meal-plan-thumb {
    width: 52px;
    height: 52px;

    border-radius: 6px;

    background-size: cover;
    background-position: center;
    background-color: #222;

    flex-shrink: 0;
}

.meal-plan-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0.6;
}

/* =========================
   Title Area
========================= */

.meal-plan-item-content {
    flex: 1;
}

.meal-plan-item-title {
    font-weight: 500;
}

/* =========================
   Remove Button
========================= */

.meal-plan-remove-btn {
    border: none;
    background: transparent;
    color: #bbb;

    font-size: 16px;
    cursor: pointer;
    padding: 6px;

    transition: color 0.15s ease;
}

.meal-plan-remove-btn:hover {
    color: #ff6b6b;
}

/* =========================
   Sortable States
========================= */

.meal-plan-item-ghost {
    opacity: 0.3;
}

.meal-plan-item-chosen {
    background: rgba(255,255,255,0.12);
}

.meal-plan-item-dragging {
    opacity: 0.8;
}


/* Form layout */

#manualMealForm {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 12px;
}

/* Labels */

#manualMealForm label {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.85;
}

/* Inputs */

#manualMealForm input,
#manualMealForm textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.25);
    color: inherit;
    font-size: 0.9rem;
}

#manualMealForm input:focus,
#manualMealForm textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.35);
    background: rgba(0,0,0,0.35);
}

/* Notes textarea */

#manualMealForm textarea {
    min-height: 80px;
    resize: vertical;
}

/* Buttons */

.manual-meal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
}

/* Cancel */

#cancelManualMealBtn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    cursor: pointer;
}

/* Save */

#saveManualMealBtn {
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: #5b7cff;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

#saveManualMealBtn:hover {
    background: #6f8eff;
}

.recipe-photo-drop-zone {
    position: relative;
    border: 1px dashed rgba(255,255,255,0.18);
    border-radius: 12px;
    padding: 16px;
    background: rgba(0,0,0,0.18);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.recipe-photo-drop-zone.is-dragover {
    border-color: rgba(129, 201, 149, 0.9);
    background: rgba(129, 201, 149, 0.08);
    box-shadow: 0 0 0 1px rgba(129, 201, 149, 0.25) inset;
}

.recipe-photo-drop-zone input[type="file"] {
    position: relative;
    z-index: 2;
}

.recipe-photo-drop-text {
    margin-top: 10px;
    font-size: 0.92rem;
    opacity: 0.82;
}

.recipe-image-gallery-modal-content {
    width: min(960px, 92vw);
    max-width: 960px;
}

.recipe-image-gallery-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recipe-image-gallery-main-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 320px;
    max-height: 65vh;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    padding: 12px;
}

.recipe-image-gallery-main-image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
}

.recipe-image-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.recipe-image-gallery-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}

.recipe-image-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-image-gallery-thumb.active {
    border-color: rgba(129, 201, 149, 0.95);
    box-shadow: 0 0 0 1px rgba(129, 201, 149, 0.35);
}

.recipe-img.recipe-gallery-trigger {
    cursor: pointer;
    max-width: 300px;
    max-height: 300px;
    width: 100%;
    height: auto;
}

.recipe-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.recipe-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    display: block;
}

.recipe-image-framed {
    position: relative;
    z-index: 1;
    width: 150px;              /* visible size before hover */
    aspect-ratio: 1 / 1;
    display: inline-block;
    overflow: visible;
    transition: transform 0.25s ease-in-out;
    transform-origin: top left;
}

.recipe-image-framed:hover {
    transform: translate(20px, 20px) scale(2.5);
    z-index: 10000;
}

.recipe-image-framed .recipe-img {
    position: absolute;
    top: 15px;                 /* inset to sit inside the frame opening */
    left: 18px;
    width: calc(100% - 36px);
    height: calc(100% - 36px);
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.recipe-image-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
}

.recipe-detail-title-wrap {
    display: flex;
    flex-direction: column;
}

.recipe-header-row,
.recipe-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.recipe-detail-title-wrap h2 {
    margin: 0;
}

.recipe-rating {
    margin-top: 4px;
}

.recipe-share-status {
    flex: 0 0 48px;
    width: auto;
    height: 48px;
    cursor: pointer;
    transition: transform .3s ease-in-out;
}

.recipe-share-status:hover {
    transform: scale(1.1);
}

.recipe-share-status.not-shared:hover {
    animation: lowPulsePurple 2.5s ease-in-out infinite;
}


.recipe-detail-card,
.recipe-detail-header,
.recipe--header-row,
.recipe-title-row {
    overflow: visible;
    position: relative;
}

.header-avatar {
    max-height: 24px;
    max-width: 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 6px;
    object-fit: cover;
}

.profile-modal {
    max-width: 720px;
    width: min(92vw, 720px);
}

.profile-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 8px 0 0;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.04);
}

.profile-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-field label {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.95;
}

.profile-field input,
.profile-field select,
.profile-static-value {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    color: #f3eee8;
    box-sizing: border-box;
}

.profile-field input:focus,
.profile-field select:focus {
    outline: none;
    border-color: rgba(140, 190, 120, 0.7);
    box-shadow: 0 0 0 2px rgba(140, 190, 120, 0.18);
}

.profile-static-value {
    display: flex;
    align-items: center;
    word-break: break-word;
    cursor: default;
    user-select: text;
}

.profile-warning {
    margin-top: 6px;
    font-size: 0.92rem;
    line-height: 1.4;
    opacity: 0.92;
}

.profile-modal .modal-footer {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
}

@media (max-width: 640px) {
    .profile-avatar-section {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-avatar {
        width: 84px;
        height: 84px;
    }
}

.allergen-alert {
    color: #c62828;
    font-weight: 600;
}


.allergen-icon {
    margin-right: 6px;
    color: #d32f2f;
    font-size: 0.85em;
    vertical-align: middle;
    max-width: 64px;
    height: auto;

    animation: warning 1s linear infinite;
}

li.allergen-alert {
    color: #d32f2f;
    font-weight: 500;
}

li.allergen-alert .allergen-icon {
    margin-right: 6px;
    font-size: 0.85em;
}

.icon {
   max-width: 64px;
   max-height: 64px;
   width: auto;
   height: auto;
   margin: 5px;
   transition: transform .5s ease-in-out;
}

.smIcon {
   max-width: 24px;
   max-height: 24px;
   width: auto;
   height: auto;
}

.icon:hover {
    transform: scale(1.2);
    animation: lowPulsePurple 1.8s infinite ease-in-out;
}


#openDeleteRecipeModalButton {
margin-left: 70px;
}

#openDeleteRecipeModalButton:hover {
    animation: redGlow 1.8s infinite ease-in-out;
}

.shared {
    animation: redGlow 4.2s infinite ease-in-out;
}

.shared:hover {
    animation: redGlow 1.8s infinite ease-in-out;

}

@keyframes redGlow {
  0% {
    filter:
      drop-shadow(0 0 2px rgba(255, 80, 40, 0.8))
      drop-shadow(0 0 4px rgba(200, 20, 20, 0.6));
  }

  50% {
    filter:
      drop-shadow(0 0 4px rgba(255, 120, 60, 0.95))
      drop-shadow(0 0 8px rgba(255, 40, 0, 0.9))
      drop-shadow(0 0 16px rgba(180, 10, 10, 0.7));
  }

  100% {
    filter:
      drop-shadow(0 0 2px rgba(255, 80, 40, 0.8))
      drop-shadow(0 0 4px rgba(200, 20, 20, 0.6));
  }
}


@keyframes lowPulsePurple {
  0% {
    filter:
      drop-shadow(0 0 1px rgba(170, 120, 255, 0.75))
      drop-shadow(0 0 2px rgba(120, 40, 220, 0.55));
  }

  50% {
    filter:
      drop-shadow(0 0 2px rgba(200, 160, 255, 0.9))
      drop-shadow(0 0 4px rgba(150, 70, 255, 0.85))
      drop-shadow(0 0 8px rgba(90, 20, 200, 0.7));
  }

  100% {
    filter:
      drop-shadow(0 0 1px rgba(170, 120, 255, 0.75))
      drop-shadow(0 0 2px rgba(120, 40, 220, 0.55));
  }
}

@keyframes warning {
  0% {
    filter: drop-shadow(0 0 0 rgba(255,0,0,0));
  }

  20% {
    filter:
      drop-shadow(0 0 6px rgba(255,40,40,0.9))
      drop-shadow(0 0 12px rgba(255,0,0,0.9));
  }

  40% {
    filter:
      drop-shadow(0 0 14px rgba(255,80,0,1))
      drop-shadow(0 0 22px rgba(255,0,0,0.95));
  }

  60% {
    filter:
      drop-shadow(0 0 8px rgba(255,40,40,0.9))
      drop-shadow(0 0 16px rgba(255,0,0,0.9));
  }

  80% {
    filter: drop-shadow(0 0 0 rgba(255,0,0,0));
  }

  100% {
    filter: drop-shadow(0 0 0 rgba(255,0,0,0));
  }
}

.return-button img {
    height: 48px;           /* adjust as needed */
    width: auto;

    transition:
        transform 0.3s ease,
        filter 0.3s ease;
}
.return-button:hover img {
    transform: scale(1.2);
    animation: returnGlow 1.6s infinite alternate;
}
@keyframes returnGlow {

    0% {
        filter:
            drop-shadow(0 0 1px rgba(255,120,40,0.6))
            drop-shadow(0 0 3px rgba(255,80,20,0.4));
    }

    100% {
        filter:
            drop-shadow(0 0 3px rgba(255,150,60,0.9))
            drop-shadow(0 0 8px rgba(255,90,30,0.8));
    }

}

.return-button {
    display: inline-flex;
    align-items: center;
    padding: 4px 6px;
}

.return-button img {
    transform: translateY(-1px);
}

.recipe-title-bar {
    display: flex;
    align-items: center;
    gap: 20px;
}

#recipe-page-title {
    margin: 0;
}

.ec-select-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 320px;
}

.ec-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 12px 42px 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-mid);
    background: var(--bg-panel);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ec-select:hover {
    border-color: var(--border-strong);
    box-shadow: var(--glow-moss);
}

.ec-select:focus {
    outline: none;
    border-color: var(--accent-moss);
    box-shadow: var(--glow-moss);
}

.ec-select-wrap::after {
    content: "▾";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-ember);
    pointer-events: none;
    font-size: 14px;
    line-height: 1;
}

.form-help {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

.recipe-time-icon {
    width: 32px;
    height: auto;
    vertical-align: middle;
    margin-right: 6px;
    transition: transform 0.6s ease-in-out;
    grid-row: span 2;
    width: 32px;
    height: auto;
}

.recipe-time-icon:hover {
    transform: scale(1.1) rotate(180deg);
}

.recipe-time-row {
    display: grid;
    grid-template-columns: 36px auto auto;
    align-items: center;
    column-gap: 12px;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.time-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.time-total {
    font-weight: 600;
}


.info-modal-content {
    width: min(960px, 92vw);
    max-height: 90vh;
    overflow: hidden;
}

.info-modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 72px);
    padding: 18px 20px 24px;
}

.info-section + .info-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.info-section h3 {
    margin: 0 0 14px;
}

.info-converter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    align-items: end;
}

.info-converter-result {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    background: rgba(255,255,255,0.06);
}

.info-converter-note {
    margin-top: 8px;
    font-size: 0.92rem;
    opacity: 0.85;
}

.info-table-wrap {
    overflow-x: auto;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table th,
.info-table td {
    text-align: left;
    padding: 10px 12px;
    vertical-align: top;
}

.info-table thead th {
    border-bottom: 1px solid rgba(255,255,255,0.16);
}

.info-table tbody tr + tr td {
    border-top: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 700px) {
    .info-converter-grid {
        grid-template-columns: 1fr;
    }

    .info-modal-body {
        padding: 16px;
    }
}

#openFavoriteWheelButton {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 9999;

    width: 56px;
    height: 56px;
    border-radius: 999px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0; /* important */
}

.favorite-wheel-icon {
    height: 36px;
    width: auto;
    display: block;
}

.floating-timer-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    cursor: pointer;
}

.timer-row {
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
}

.timer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.floating-timer-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
}

.floating-timer-button:hover {
    transform: scale(1.1);
}

.timer-button-icon {
    line-height: 1;
    font-size: 18px;
    width: 32px;
    height: auto;
}

.timer-button-display {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.timer-button-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.floating-timer-button:not(.has-active-timers) .timer-button-display,
.floating-timer-button:not(.has-active-timers) .timer-button-count {
    display: none;
}

.timer-minute-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 14px;
}

.timer-minute-controls .timer-preset,
.timer-minute-controls .timer-adjust-minutes {
    width: 48px;
    min-width: 48px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.05;
    font-size: 11px;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.08s ease;
}
.timer-adjust-minutes:hover,
.timer-preset:hover,
.timer-add-time:hover,
.timer-subtract-time:hover {

    background: color-mix(in srgb, var(--accent-moss) 18%, transparent);
    border-color: var(--accent-moss);
    color: var(--text-main);

    transform: translateY(-1px);
}
.timer-adjust-minutes:active,
.timer-preset:active,
.timer-add-time:active,
.timer-subtract-time:active {

    transform: translateY(1px);
}

.timer-status-message {
    border-color: rgba(214, 107, 107, 0.38);
    box-shadow: 0 0 12px rgba(214, 107, 107, 0.16);
}

.timer-duration-fields {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.timer-duration-part {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.timer-duration-fields .timer-input {
    width: 70px !important;
    min-width: 70px;
    max-width: 70px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    padding: 4px 6px;
}

.timer-duration-sep {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 12px;
}

.timer-end-preview {
    font-size: 13px;
    opacity: 0.7;
    margin-top: 8px;
}

#timer_label {
width: 350px;;
}

#timerEditor {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}



.recipe-rating-widget {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.recipe-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.recipe-rating-star {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.recipe-rating-icon {
    width: 28px;
    height: auto;
    display: block;
    pointer-events: none;
    user-select: none;
}

.recipe-rating-hit {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 2;
}

.recipe-rating-hit-left {
    left: 0;
}

.recipe-rating-hit-right {
    right: 0;
}

.recipe-rating-value {
    min-width: 36px;
    font-weight: 600;
    opacity: 0.85;
}

.recipe-rating-star.is-preview-add .recipe-rating-icon {
    filter: drop-shadow(0 0 4px rgba(255, 210, 120, 0.55));
    opacity: 1;
}

.recipe-rating-star.is-preview-remove .recipe-rating-icon {
    opacity: 0.35;
}
.recipe-title-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recipe-favorite-toggle {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    line-height: 0;
}

.recipe-favorite-icon {
    width: 32px;
    height: 32px;
    display: block;
    transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.recipe-favorite-toggle:hover .recipe-favorite-icon,
.recipe-favorite-toggle:focus-visible .recipe-favorite-icon {
    transform: scale(1.08);
    filter: drop-shadow(0 0 6px rgba(255, 120, 140, 0.35));
}

.recipe-favorite-toggle:disabled .recipe-favorite-icon,
.recipe-favorite-toggle[data-saving="1"] .recipe-favorite-icon {
    opacity: 0.7;
}

.wheel-modal-content .modal-body {
    padding-top: 8px;
}

.favorite-wheel-layout {
    display: grid;
    grid-template-columns: 700px minmax(280px, 1fr);
    gap: 24px;
    align-items: start;
}

.favorite-wheel-main {
    min-width: 0;
}

.favorite-wheel-sidebar {
    min-width: 0;
    padding-top: 28px;
}

#favorite-wheel-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.wheel-frame-wrap {
    position: relative;
    width: 660px;
    aspect-ratio: 905 / 872;
    overflow: visible;
    margin: 0 0 18px 0;
}

.wheel-frame-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
}

/*
    These values place the wheel inside the circular opening
    of your specific 905x872 frame image.
    Tweak only these three values if needed.
*/
#favoriteWheelCanvas {
    position: absolute;

    width: 480px;
    height: 480px;

    left: 55%;
    top: 50%;

    transform: translate(-50%, -50%);
    z-index: 1;
    display: block;
    max-width: none;

    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.favorite-wheel-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.favorite-wheel-filters label {
    font-weight: 600;
}

.favorite-wheel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

#favoriteWheelResult {
    margin-top: 12px;
}

#favoriteWheelWinnerLink {
    display: inline-block;
    margin-top: 6px;
}

@media (max-width: 1180px) {
    .favorite-wheel-layout {
        grid-template-columns: 1fr;
    }

    .favorite-wheel-sidebar {
        padding-top: 0;
    }

    .wheel-frame-wrap {
        width: 100%;
        max-width: 660px;
        height: auto;
    }
}

.floating-tools-wrap {
    position: fixed;
    right: 20px;
    bottom: 96px; /* sits above timer button */
    z-index: 1200;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 12px;
}

.floating-tools-toggle {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.5s ease-in-out;

}

.floating-tools-toggle:hover {
transform: scale(1.2);
}

.floating-tools-toggle-icon {
    width: 48px;
    height: auto;
    object-fit: contain;
}

.floating-tools-drawer {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);

    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);

    border: 2px solid var(--border-strong);
background: var(--bg-shell);
    padding: 8px;
    border-radius: 12px;
    backdrop-filter: blur(4px);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s linear 0.18s;
}

.floating-tools-wrap.open .floating-tools-drawer {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s linear 0s;
}

.floating-tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;

    min-width: 190px;
    min-height: 48px;
    padding: 0 16px;

    border-radius: 999px;
    white-space: nowrap;

    text-decoration: none;   /* ← THIS is key for <a> */
    color: inherit;          /* ← prevents link-blue nonsense */

    box-sizing: border-box;
}

.floating-tool-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex: 0 0 22px;
}

.floating-tool-label {
    line-height: 1;
    font-weight: 600;
}


.floating-timer-button,
.floating-tools-toggle {
    background: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--button-border);
    border-radius: 999px;

    /* depth */
    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.45),
        0 0 0 1px var(--border-soft);

}
.floating-timer-button::after,
.floating-tools-toggle::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;

    box-shadow:
        0 0 12px var(--ts-control-glow),
        0 0 20px var(--ts-control-glow);

    pointer-events: none;
}
.floating-timer-button:hover,
.floating-tools-toggle:hover {
    background: var(--button-bg-hover-bg);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.55),
        var(--button-bg-hover-glow);
}

.floating-tools-drawer .ec-divider {
    align-self: stretch;
    width: auto;
    min-width: 190px;
    margin: 2px 0;
    flex: 0 0 auto;
}

.shared-recipes-modal-content {
    max-width: 900px;
    width: min(900px, calc(100vw - 32px));
}

.shared-recipes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}

.shared-recipe-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--bg-panel-soft);
    align-items: center;
}

.shared-recipe-main {
    flex: 1;
    min-width: 0;
}

.shared-recipe-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.shared-recipe-link {
    width: 100%;
}

.shared-recipe-url {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
}

.shared-recipe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.shared-recipe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border-mid);
    background: var(--bg-shell);
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.shared-recipe-btn:hover {
    border-color: var(--border-strong);
}

.shared-recipe-btn-danger {
    color: var(--text-heading);
}

.shared-recipes-loading,
.shared-recipes-empty {
    padding: 18px;
    border-radius: 12px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-soft);
    color: var(--text-soft);
}

@media (max-width: 720px) {
    .shared-recipe-row {
        flex-direction: column;
        align-items: stretch;
    }

    .shared-recipe-actions {
        justify-content: flex-start;
    }
}

/* Pantry Match */
/* ===== Pantry Match Modal ===== */

.pantry-match-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pantry-match-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 16px;
    align-items: start;
}

.pantry-match-field label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Toolbar row */
.pantry-match-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}


#pantryIngredientSelect + .ts-wrapper.multi .ts-control {
    min-height: 58px;
    padding: 8px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    gap: 6px;
}

#pantryIngredientSelect + .ts-wrapper.multi .ts-control > input {
    height: 22px !important;
    line-height: 22px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: center;
    padding-left: 8px !important;
}

#pantryIngredientSelect + .ts-wrapper.multi .item {
    margin: 0;
}

#pantryIngredientSelect + .ts-wrapper.multi.has-items .ts-control {
    padding-top: 8px;
    padding-bottom: 8px;
}


.pantry-match-missing-field {
    min-width: 140px;
}

/* Loading / empty */
.pantry-match-loading,
.pantry-match-empty {
    font-size: 14px;
    color: var(--text-soft);
    opacity: 0.8;
}

/* Results */
.pantry-match-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Group */
.pantry-match-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pantry-match-group-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-heading);
}

/* Cards */
.pantry-match-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Header */
.pantry-match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pantry-match-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pantry-match-card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-heading);
}

/* Link */
.pantry-match-open-link {
    font-size: 13px;
    text-decoration: none;
    color: var(--accent-ember);
}

.pantry-match-open-link:hover {
    text-decoration: underline;
}

/* Description */
.pantry-match-card-description {
    font-size: 13px;
    color: var(--text-soft);
}

/* Meta pills */
.pantry-match-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pantry-match-meta-pill {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bg-panel-soft);
    border: 1px solid var(--border-soft);
}

.pantry-match-meta-pill-ready {
    background: rgba(120, 200, 120, 0.15);
    border-color: rgba(120, 200, 120, 0.4);
}

.pantry-match-meta-pill-missing {
    background: rgba(200, 160, 120, 0.15);
    border-color: rgba(200, 160, 120, 0.4);
}

/* Ingredient sections */
.pantry-match-section-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* Chips */
.pantry-match-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pantry-match-chip {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--bg-input);
}

.pantry-match-chip-matched {
    background: rgba(120, 200, 120, 0.12);
    border-color: rgba(120, 200, 120, 0.3);
}

.pantry-match-chip-missing {
    background: rgba(200, 120, 120, 0.12);
    border-color: rgba(200, 120, 120, 0.3);
}

/* Empty state inside groups */
.pantry-match-none {
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* End Pantry Match */

.recipe-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.recipe-title-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.recipe-title-left h2 {
    margin: 0;
}

.recipe-title-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.recipe-sort-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.recipe-title-actions .ts-wrapper {
    width: 190px;
    min-width: 190px;
}

.recipe-title-actions .ts-control {
    min-height: 2.35rem;
    display: flex;
    align-items: center;
}

/* ==============================
   Shopping List Modal
   ============================== */

.shopping-list-modal-content {
    max-width: 900px;
    width: min(92vw, 900px);
    max-height: 82vh;
    display: flex;
    flex-direction: column;
}

.shopping-list-body {
    overflow-y: auto;
    padding-right: 0.35rem;
}

.shopping-list-status {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-panel-soft);
    color: var(--text-muted);
}

.shopping-list-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shopping-list-section {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-panel-soft);
}

.shopping-list-section h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

.shopping-list-help {
    margin: -0.35rem 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.shopping-list-items {
    columns: 2;
    column-gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.shopping-list-item {
    break-inside: avoid;
    display: block;
    padding: 0.25rem 0;
    border-bottom: none;
}

.shopping-list-text {
    color: var(--text-main);
    line-height: 1.35;
}

.shopping-list-reason {
    display: block;
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.shopping-list-empty {
    break-inside: avoid;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem 0;
}

/* Review section can be a little denser because those lines are usually longer */
.review-section .shopping-list-items {
    columns: 1;
}

.review-section .shopping-list-item {
    padding: 0.4rem 0;
}

/* Mobile */
@media (max-width: 700px) {
    .shopping-list-modal-content {
        width: min(94vw, 720px);
        max-height: 88vh;
    }

    .shopping-list-items {
        columns: 1;
    }

    .shopping-list-section {
        padding: 0.85rem;
    }
}

.shopping-list-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

#copyShoppingListButton {
    white-space: nowrap;
}
