/* content/tools/my-recipes/my-recipes.css
 *
 * Styles for /my-recipes — recipe gallery + detail (cooking-mode) modal.
 *
 * Reuses the food diary's design tokens (--primary-color, --card-bg,
 * --text-color, etc.) which are defined globally in template/css/style.css.
 * The diary-specific tokens (--accent-color, --surface-muted, --r-*, --s-*)
 * are NOT global — they live inside diary.css. To keep this stylesheet
 * self-contained, we redeclare them once at :root + dark theme below.
 *
 * Anything that's already defined globally (token-wise) we use directly.
 *
 * Print + QR-modal rules are duplicated from diary.css so /my-recipes
 * doesn't depend on the diary's stylesheet being loaded.
 */

/* ════════════════════════════════════════════════════════════════════════
 * DESIGN TOKENS — borrowed from diary.css. Same values; if these ever
 * diverge from the diary's, both pages should be moved to a shared base.
 * ════════════════════════════════════════════════════════════════════════ */
:root {
    --primary-soft:   #dbeafe;
    --primary-dark:   #1d4ed8;
    --accent-color:   #16a34a;
    --accent-soft:    #dcfce7;
    --error-color:    #dc2626;
    --error-soft:     #fef2f2;
    --error-strong:   #b91c1c;
    --error-border:   #fca5a5;
    --surface-muted:  #f3f4f6;
    --shadow-card:    0 1px 2px rgba(17, 24, 39, 0.04), 0 4px 12px rgba(17, 24, 39, 0.06);
    --shadow-pop:     0 8px 24px rgba(17, 24, 39, 0.12);
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
    --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
}
[data-theme="dark"] {
    --primary-soft:   rgba(96, 165, 250, 0.15);
    --primary-dark:   #93c5fd;
    --accent-color:   #4ade80;
    --accent-soft:    rgba(74, 222, 128, 0.15);
    --error-color:    #f87171;
    --error-soft:     rgba(248, 113, 113, 0.15);
    --error-strong:   #fecaca;
    --error-border:   rgba(248, 113, 113, 0.45);
    --surface-muted:  #273449;
    --shadow-card:    0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-pop:     0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ════════════════════════════════════════════════════════════════════════
 * PAGE WRAPPER + INTRO
 * ════════════════════════════════════════════════════════════════════════ */
.my-recipes-app {
    max-width: 880px;
    margin: 0 auto;
    padding: var(--s-4) var(--s-4) var(--s-10);
}
.my-recipes-intro {
    color: var(--text-light);
    line-height: 1.5;
    margin: 0 0 var(--s-5);
}

/* ════════════════════════════════════════════════════════════════════════
 * SEARCH + CATEGORY FILTER
 * ════════════════════════════════════════════════════════════════════════ */
.my-recipes-controls {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin-bottom: var(--s-3);
}
.my-recipes-search input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: var(--s-3) var(--s-3) var(--s-3) var(--s-10);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    background: var(--card-bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat var(--s-3) center;
    color: var(--text-color);
    min-height: 48px;
}
.my-recipes-search input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    border-color: var(--primary-color);
}
.my-recipes-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}
.cat-chip {
    appearance: none;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    padding: 6px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--r-pill);
    cursor: pointer;
    min-height: 36px;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.cat-chip:hover {
    background: var(--surface-muted);
    border-color: var(--primary-color);
}
.cat-chip.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--card-bg);
}

/* ════════════════════════════════════════════════════════════════════════
 * BULK ACTIONS
 * ════════════════════════════════════════════════════════════════════════ */
.my-recipes-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-bottom: var(--s-4);
    align-items: center;
}
.my-recipes-new-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: var(--s-2) var(--s-4);
    background: var(--primary-color);
    color: var(--card-bg);
    border-radius: var(--r-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    min-height: 40px;
}
.my-recipes-new-link:hover,
.my-recipes-new-link:focus-visible {
    background: var(--primary-dark);
    outline: none;
}
.my-recipes-actions .is-secondary {
    appearance: none;
    border: 1px dashed var(--border-strong);
    background: transparent;
    color: var(--primary-color);
    padding: var(--s-2) var(--s-3);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--r-md);
    cursor: pointer;
    min-height: 40px;
}
.my-recipes-actions .is-secondary:hover,
.my-recipes-actions .is-secondary:focus-visible {
    background: var(--primary-soft);
    border-color: var(--primary-color);
    outline: none;
}

/* ════════════════════════════════════════════════════════════════════════
 * RECIPE GRID
 * ════════════════════════════════════════════════════════════════════════ */
.my-recipes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-3);
}
@media (min-width: 560px) {
    .my-recipes-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 880px) {
    .my-recipes-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.recipe-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-color);  /* same green-edge accent as templates in the diary */
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 80ms ease, box-shadow 120ms ease, border-color 120ms ease;
    display: flex;
    flex-direction: column;
}
.recipe-card:hover,
.recipe-card:focus-visible {
    border-color: var(--primary-color);
    border-left-color: var(--accent-color);
    box-shadow: var(--shadow-card);
    transform: translateY(-1px);
}
.recipe-card:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.recipe-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.recipe-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.recipe-card-fallback {
    font-size: 48px;
    opacity: 0.4;
    line-height: 1;
}
.recipe-card-info {
    padding: var(--s-3);
}
.recipe-card-name {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    overflow-wrap: anywhere;
    border: 0;
    padding: 0;
}
.recipe-card-meta {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ════════════════════════════════════════════════════════════════════════
 * EMPTY STATES
 * ════════════════════════════════════════════════════════════════════════ */
.my-recipes-empty {
    padding: var(--s-10) var(--s-4);
    text-align: center;
    background: var(--surface-muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-lg);
    color: var(--text-muted);
}
.my-recipes-empty .empty-icon {
    font-size: 56px;
    display: block;
    margin: 0 auto var(--s-3);
    opacity: 0.55;
    line-height: 1;
}
.my-recipes-empty h2 {
    margin: 0 0 var(--s-2);
    font-size: 20px;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.25;
    border: 0;
    padding: 0;
}
.my-recipes-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════════════
 * DETAIL MODAL — cooking display + edit panel
 *
 * Full-screen on mobile (max width 100vw, max height 100vh) so cooking
 * users get every pixel of readable surface. On tablet+ centred panel
 * with a sensible max-width.
 * ════════════════════════════════════════════════════════════════════════ */
.my-recipes-detail-modal[hidden] { display: none; }
.my-recipes-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow-y: auto;
    background: var(--background);
}
.my-recipes-detail-modal .modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: -1;
}
.my-recipes-detail-modal .modal-inner {
    position: relative;
    width: 100%;
    max-width: 720px;
    background: var(--card-bg);
    color: var(--text-color);
    padding: 0;
    overflow-y: auto;
    border-radius: 0;
}
@media (min-width: 720px) {
    .my-recipes-detail-modal {
        align-items: flex-start;
        padding: var(--s-4);
    }
    .my-recipes-detail-modal .modal-inner {
        margin: var(--s-4) auto;
        border: 1px solid var(--border-color);
        border-radius: var(--r-lg);
        box-shadow: var(--shadow-pop);
    }
}
.my-recipes-detail-modal .modal-close {
    position: fixed;
    top: var(--s-2);
    right: var(--s-2);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.65);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}
.my-recipes-detail-modal .modal-close:hover,
.my-recipes-detail-modal .modal-close:focus-visible {
    background: rgba(17, 24, 39, 0.85);
    outline: 2px solid var(--card-bg);
    outline-offset: 1px;
}

/* Detail VIEW — read-only cooking layout, large readable text */
.detail-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.detail-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.detail-hero-fallback {
    font-size: 96px;
    opacity: 0.35;
    line-height: 1;
}
.detail-header {
    padding: var(--s-4) var(--s-4) 0;
}
.detail-title {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
    overflow-wrap: anywhere;
    border: 0;
    padding: 0;
}
.detail-category {
    margin: 0 0 var(--s-3);
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.detail-section {
    padding: var(--s-3) var(--s-4);
}
.detail-section h3 {
    margin: 0 0 var(--s-2);
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    border: 0;
    padding: 0;
    line-height: 1.2;
}
.detail-ingredients {
    list-style: none;
    margin: 0 0 var(--s-3);
    padding: 0;
}
.detail-ing {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: var(--s-2);
    padding: var(--s-2) 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 16px;
    line-height: 1.4;
    align-items: baseline;
}
.detail-ing:last-child { border-bottom: 0; }
.detail-ing-portion {
    font-weight: 600;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}
.detail-ing-name {
    color: var(--text-color);
    overflow-wrap: anywhere;
}
.detail-ing-kcal {
    color: var(--text-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.detail-totals {
    margin-top: var(--s-3);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border-color);
}
.detail-totals-kcal {
    display: block;
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 2px;
}
.detail-totals-kcal strong {
    font-size: 20px;
    font-weight: 700;
}
.detail-totals-macros {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.detail-instructions {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-color);
    white-space: normal;
    overflow-wrap: anywhere;
}
/* Auto-rendered ordered/unordered list inside the instructions section.
 * Wider gutter than browser-default so each step has visual breathing room
 * — important when reading from the kitchen at arm's length. */
.detail-instructions .recipe-instructions-list {
    margin: 0;
    padding-left: var(--s-6);
}
.detail-instructions .recipe-instructions-list > li {
    margin-bottom: var(--s-3);
    padding-left: var(--s-1);
    line-height: 1.65;
}
.detail-instructions .recipe-instructions-list > li::marker {
    color: var(--primary-color);
    font-weight: 600;
}
.detail-instructions > p {
    margin: 0 0 var(--s-3);
    line-height: 1.7;
}

/* Detail action row (view mode) */
.detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4) var(--s-5);
    border-top: 1px solid var(--border-color);
    background: var(--surface-muted);
}
@media (min-width: 560px) {
    .detail-actions { grid-template-columns: repeat(3, 1fr); }
}
.detail-actions button {
    appearance: none;
    border: 1px solid var(--border-strong);
    background: var(--card-bg);
    color: var(--text-color);
    padding: var(--s-3);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--r-md);
    cursor: pointer;
    min-height: 44px;
}
.detail-actions button:hover,
.detail-actions button:focus-visible {
    border-color: var(--primary-color);
    color: var(--primary-color);
    outline: none;
}
.detail-actions .js-edit-details {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--card-bg);
    grid-column: 1 / -1;
}
.detail-actions .js-edit-details:hover,
.detail-actions .js-edit-details:focus-visible {
    background: var(--primary-dark);
    color: var(--card-bg);
}
.detail-actions .js-delete {
    background: var(--card-bg);
    color: var(--error-strong);
    border-color: var(--error-border);
}
.detail-actions .js-delete:hover,
.detail-actions .js-delete:focus-visible {
    background: var(--error-soft);
}

/* Utensils section in the cooking-display view — slightly muted so it
 * doesn't compete with ingredients. */
.detail-section--utensils .detail-utensils {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
}
.detail-utensils .recipe-instructions-list {
    margin: 0;
    padding-left: var(--s-5);
}
.detail-utensils .recipe-instructions-list > li {
    margin-bottom: 4px;
}
.detail-utensils > p {
    margin: 0;
}

/* Notes — soft tinted plate, distinct from the main content. */
.detail-section--notes .detail-notes {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent-color);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
    overflow-wrap: anywhere;
}
.detail-notes .recipe-instructions-list {
    margin: 0;
    padding-left: var(--s-5);
}
.detail-notes .recipe-instructions-list > li {
    margin-bottom: 4px;
}
.detail-notes > p {
    margin: 0;
}

/* Detail EDIT — form */
.detail-edit {
    padding: var(--s-4);
}
.detail-edit-field-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
    margin-bottom: 4px;
    line-height: 1.4;
}
.detail-edit-field .field-optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 12px;
}

/* Live preview block under the instructions textarea. Shows the
 * auto-rendered list as the user types so they can see the format
 * immediately rather than guessing. Hidden when the textarea is empty. */
.detail-edit-preview-wrap {
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    padding: var(--s-3);
    margin: -8px 0 var(--s-3);          /* nudges up against the textarea */
}
.detail-edit-preview-wrap[hidden] { display: none; }
.detail-edit-preview-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}
.detail-edit-preview {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
}
.detail-edit-preview .recipe-instructions-list {
    margin: 0;
    padding-left: var(--s-5);
}
.detail-edit-preview .recipe-instructions-list > li {
    margin-bottom: 4px;
}
.detail-edit-preview .recipe-instructions-list > li::marker {
    color: var(--primary-color);
    font-weight: 600;
}
.detail-edit-preview > p { margin: 0; }
.detail-back-btn {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--primary-color);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    padding: 0 0 var(--s-2);
    margin-bottom: var(--s-3);
}
.detail-back-btn:hover,
.detail-back-btn:focus-visible {
    text-decoration: underline;
    outline: none;
}
.detail-edit h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.25;
    border: 0;
    padding: 0;
}
.detail-edit-hint {
    margin: 0 0 var(--s-4);
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}
.detail-edit-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--s-3);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    line-height: 1.3;
}
.detail-edit-field input,
.detail-edit-field select,
.detail-edit-field textarea {
    font-size: 16px;
    font-family: inherit;
    line-height: 1.4;
    padding: var(--s-3);
    border: 1px solid var(--border-color);
    border-radius: var(--r-md);
    background: var(--card-bg);
    color: var(--text-color);
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
}
.detail-edit-field textarea {
    min-height: 6rem;
    resize: vertical;
    line-height: 1.5;
}
.detail-edit-field input:focus,
.detail-edit-field select:focus,
.detail-edit-field textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    border-color: var(--primary-color);
}
.detail-edit-field select option {
    color: var(--text-color);
    background: var(--card-bg);
}
.detail-edit-photo-block {
    margin-bottom: var(--s-4);
}
.detail-edit-photo-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
}

/* Photo trigger reuses food-diary's classes; supply minimal local rules
 * so /my-recipes doesn't depend on diary.css being loaded. */
.my-recipes-app .diary-photo-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-md);
    background: var(--surface-muted);
    color: var(--text-color);
    cursor: pointer;
    min-height: 48px;
    font-size: 14px;
    line-height: 1.3;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.my-recipes-app .diary-photo-trigger:hover,
.my-recipes-app .diary-photo-trigger:focus-within {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.my-recipes-app .diary-photo-trigger input[type="file"] {
    position: absolute;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.my-recipes-app .diary-photo-preview {
    display: none;
    margin-top: var(--s-2);
}
.my-recipes-app .diary-photo-preview.has-photo { display: flex; justify-content: center; }
.my-recipes-app .diary-photo-preview-frame {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.my-recipes-app .diary-photo-preview img {
    max-width: 100%;
    max-height: 280px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-color);
    display: block;
}
.my-recipes-app .diary-photo-preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.65);
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.my-recipes-app .diary-photo-preview-remove:hover,
.my-recipes-app .diary-photo-preview-remove:focus-visible {
    background: rgba(17, 24, 39, 0.85);
    outline: 2px solid var(--card-bg);
    outline-offset: 1px;
}

.detail-edit-actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-top: var(--s-4);
}
@media (min-width: 480px) {
    .detail-edit-actions { flex-direction: row; }
    .detail-edit-actions button { flex: 1; }
}
.detail-edit-actions button {
    appearance: none;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: var(--card-bg);
    padding: var(--s-3) var(--s-4);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--r-md);
    cursor: pointer;
    min-height: 44px;
}
.detail-edit-actions button.is-secondary {
    background: var(--card-bg);
    color: var(--primary-color);
}
.detail-edit-actions button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.detail-empty {
    padding: var(--s-3);
    color: var(--text-muted);
    font-style: italic;
    list-style: none;
}

/* Open-modal body lock (prevent background scroll) */
body.my-recipes-modal-open { overflow: hidden; }

/* ════════════════════════════════════════════════════════════════════════
 * QR SHARE MODAL — duplicated from diary.css so this stylesheet is
 * self-contained.
 * ════════════════════════════════════════════════════════════════════════ */
.diary-qr-modal[hidden] { display: none; }
.diary-qr-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--s-3);
}
.diary-qr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
}
.diary-qr-modal-inner {
    position: relative;
    width: 100%;
    max-width: 360px;
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--r-lg);
    padding: var(--s-5) var(--s-4) var(--s-4);
    box-shadow: var(--shadow-pop);
    text-align: center;
}
.diary-qr-modal-close {
    position: absolute;
    top: var(--s-2);
    right: var(--s-2);
    width: 36px; height: 36px;
    border: 0; border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    font-size: 22px; line-height: 1;
    cursor: pointer; padding: 0;
}
.diary-qr-modal-close:hover,
.diary-qr-modal-close:focus-visible {
    background: var(--surface-muted);
    color: var(--text-color);
    outline: none;
}
.diary-qr-modal-title {
    margin: 0 var(--s-8) var(--s-1) 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.25;
    text-align: left;
}
.diary-qr-modal-hint {
    margin: 0 0 var(--s-3);
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    text-align: left;
}
.diary-qr-modal-canvas {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--s-3);
    background: #ffffff;
    border-radius: var(--r-md);
    margin-bottom: var(--s-3);
}
.diary-qr-modal-canvas svg {
    color: #111;
    max-width: 100%;
    height: auto;
}
.diary-qr-modal-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ════════════════════════════════════════════════════════════════════════
 * PRINT — duplicated from diary.css so /my-recipes prints standalone.
 * ════════════════════════════════════════════════════════════════════════ */
.diary-print-recipe { display: none; }

@media print {
    body.is-printing-recipe > *:not(.my-recipes-app),
    body.is-printing-recipe .my-recipes-app > *:not(#my-recipes-print-host),
    body.is-printing-recipe .my-recipes-detail-modal,
    body.is-printing-recipe .diary-qr-modal {
        display: none !important;
    }
    body.is-printing-recipe .diary-print-recipe {
        display: block !important;
    }
    body.is-printing-recipe {
        background: #fff !important;
        color: #111 !important;
    }
    .print-recipe-card {
        max-width: 720px;
        margin: 0 auto;
        padding: 12mm 8mm;
        font-family: Georgia, 'Times New Roman', serif;
        line-height: 1.5;
        color: #111;
    }
    .print-header h1 { font-size: 28pt; margin: 0 0 4pt; line-height: 1.1; }
    .print-category {
        margin: 0 0 18pt;
        font-size: 11pt;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #555;
    }
    .print-section { page-break-inside: avoid; margin-bottom: 18pt; }
    .print-section h2 {
        font-size: 14pt; margin: 0 0 8pt;
        text-transform: uppercase; letter-spacing: 0.06em;
        color: #333; border-bottom: 1pt solid #aaa; padding-bottom: 3pt;
    }
    .print-ingredients {
        width: 100%; border-collapse: collapse; font-size: 11pt;
    }
    .print-ingredients td {
        padding: 4pt 0;
        border-bottom: 0.25pt dotted #bbb;
        vertical-align: top;
    }
    .print-ing-portion {
        width: 80pt; font-weight: 600; white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }
    .print-ing-kcal {
        width: 70pt; text-align: right; color: #555;
        font-variant-numeric: tabular-nums; white-space: nowrap;
    }
    .print-totals { margin: 8pt 0 0; font-size: 11pt; color: #333; }
    .print-instructions {
        font-size: 12pt; line-height: 1.6;
        color: #222;
    }
    .print-instructions .recipe-instructions-list {
        margin: 0;
        padding-left: 18pt;
    }
    .print-instructions .recipe-instructions-list > li {
        margin-bottom: 6pt;
        line-height: 1.55;
    }
    .print-instructions > p {
        margin: 0 0 6pt;
    }
    .print-utensils, .print-notes {
        font-size: 11pt;
        line-height: 1.5;
        color: #333;
    }
    .print-utensils .recipe-instructions-list,
    .print-notes .recipe-instructions-list {
        margin: 0;
        padding-left: 18pt;
    }
    .print-utensils .recipe-instructions-list > li,
    .print-notes .recipe-instructions-list > li {
        margin-bottom: 4pt;
    }
    .print-notes {
        border-left: 1.5pt solid #aaa;
        padding-left: 8pt;
        font-style: italic;
    }
    .print-footer {
        margin-top: 36pt; font-size: 9pt; color: #888;
        border-top: 0.5pt solid #ddd; padding-top: 6pt; text-align: center;
    }
}
