    /* ==============================================
       TRIBUTE PAGE - Tabbed Layout
       4 Template Styles: Classic | Lavender | Ocean | Eternal
       ============================================== */

    /* --- Shared base --- */
    body { overflow-x: hidden; }
    body.tpl-classic  { background: var(--bg-primary); }
    body.tpl-lavender { background: #EDE8F5; }
    body.tpl-ocean    { background: #E8F1F8; }
    body.tpl-eternal  { background: #1A1514; color: #E8DFD6; }
    body { transition: background 0.4s ease, color 0.4s ease; }

    /* ================================================
       LOADING / 404
       ================================================ */
    .tribute-loading {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        min-height: 60vh; gap: 16px;
    }
    .tribute-loading-spinner {
        width: 36px; height: 36px;
        border: 2px solid rgba(44, 35, 33, 0.1); border-top-color: var(--primary-orange);
        border-radius: 50%; animation: tribute-spin 0.8s linear infinite;
    }
    .tribute-loading-text { font-size: 0.9rem; color: var(--text-muted); }
    @keyframes tribute-spin { to { transform: rotate(360deg); } }

    .tribute-not-found {
        display: none; flex-direction: column; align-items: center; justify-content: center;
        min-height: 60vh; text-align: center; padding: 40px 20px;
    }
    .tribute-not-found.visible { display: flex; }
    .tribute-not-found-icon { width: 64px; height: 64px; color: var(--text-muted); margin-bottom: 16px; }
    .tribute-not-found h2 { font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 8px; }
    .tribute-not-found p { color: var(--text-secondary); margin-bottom: 24px; max-width: 400px; }
    .tribute-not-found a {
        display: inline-flex; align-items: center; gap: 8px;
        padding: 12px 24px; background: var(--primary-orange); color: #fff;
        border-radius: 12px; font-weight: 700; font-size: 0.9rem; transition: background 0.15s;
    }
    .tribute-not-found a:hover { background: var(--primary-orange-dark); }
    body.tpl-eternal .tribute-not-found h2 { color: #E8DFD6; }
    body.tpl-eternal .tribute-not-found p { color: #9B8E87; }
    body.tpl-eternal .tribute-loading-text { color: #9B8E87; }
    body.tpl-eternal .tribute-loading-spinner { border-color: rgba(255,255,255,0.08); border-top-color: #D4A03E; }

    /* ================================================
       TEMPLATE SWITCHER
       ================================================ */
    .template-switcher {
        display: flex; justify-content: center; align-items: center; gap: 6px; padding: 6px 10px;
        background: rgba(44, 35, 33, 0.05); border-radius: 12px;
        border: 2px solid rgba(44, 35, 33, 0.08);
        margin-bottom: 28px; width: fit-content; margin-left: auto; margin-right: auto;
        flex-wrap: wrap;
    }
    .template-switcher-label {
        display: flex; align-items: center;
        font-size: 0.82rem; font-weight: 800; color: var(--text-primary);
        padding: 0 8px 0 4px; white-space: nowrap;
        border-right: 2px solid rgba(44, 35, 33, 0.1); margin-right: 2px; padding-right: 12px;
    }
    body.tpl-eternal .template-switcher { border-color: rgba(255, 255, 255, 0.08); }
    body.tpl-eternal .template-switcher-label { color: #9B8E87; border-right-color: rgba(255, 255, 255, 0.08); }
    body.tpl-eternal .template-switcher { background: rgba(255, 255, 255, 0.06); }
    .template-switcher button {
        display: flex; align-items: center; gap: 6px; padding: 8px 16px;
        border-radius: 8px; border: none; font-family: var(--font-body);
        font-weight: 600; font-size: 0.78rem; cursor: pointer;
        transition: all 0.2s ease; background: transparent; color: var(--text-muted);
    }
    body.tpl-eternal .template-switcher button { color: #9B8E87; }
    .template-switcher button .icon { width: 14px; height: 14px; }
    .template-switcher button:hover { background: rgba(44, 35, 33, 0.06); }
    body.tpl-eternal .template-switcher button:hover { background: rgba(255, 255, 255, 0.06); }
    .template-switcher button.active {
        background: #fff; color: var(--text-primary); box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }
    body.tpl-eternal .template-switcher button.active {
        background: rgba(255,255,255,0.1); color: #E8DFD6; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    }

    /* ================================================
       MAIN CONTENT
       ================================================ */
    .tribute-content {
        display: none; max-width: 720px; margin: 0 auto; padding: 72px 20px 60px;
    }
    .tribute-content.visible { display: block; }

    /* Header card -- groups hero through actions into one visual unit */
    .tribute-header-card {
        margin-bottom: 0;
    }
    .tribute-toast {
        position: fixed; bottom: 24px; left: 50%;
        transform: translateX(-50%) translateY(80px);
        padding: 12px 24px; border-radius: 12px; font-size: 0.85rem; font-weight: 600;
        box-shadow: 0 8px 32px rgba(0,0,0,0.2); z-index: 1000; opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease; pointer-events: none;
        background: var(--text-primary); color: #fff;
    }
    .tribute-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

    /* ================================================
       HERO + HEADER (always visible above tabs)
       ================================================ */
    .tribute-hero {
        position: relative; width: 100%; border-radius: 16px;
        overflow: hidden; background: var(--bg-accent); margin-bottom: 24px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    }
    .tribute-hero img { width: 100%; max-height: 480px; object-fit: cover; display: block; }
    .tribute-hero-placeholder {
        width: 100%; height: 280px; display: flex; align-items: center; justify-content: center;
        background: linear-gradient(145deg, var(--bg-accent), var(--bg-warm)); color: var(--text-muted);
    }
    .tribute-hero-placeholder .icon { width: 48px; height: 48px; }
    .tribute-occasion-badge {
        position: absolute; top: 16px; left: 16px;
        display: inline-flex; align-items: center; gap: 6px;
        padding: 6px 14px; border-radius: 9999px;
        font-family: var(--font-body); font-size: 0.78rem; font-weight: 700;
        color: #fff; background: rgba(0,0,0,0.45);
        backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    }
    .tribute-occasion-badge .icon { width: 14px; height: 14px; }
    .tribute-occasion-badge.memorial { background: rgba(53, 133, 133, 0.7); }
    /* --- Banner header: occasion label, name, meta + actions row --- */
    .tribute-occasion-label {
        font-family: var(--font-body); font-size: 0.72rem; font-weight: 700;
        text-transform: uppercase; letter-spacing: 0.08em;
        color: var(--text-muted); margin-bottom: 4px; text-align: center;
    }
    .tribute-header { text-align: center; margin-bottom: 4px; }
    .tribute-pet-name {
        font-family: 'DM Serif Display', Georgia, serif; font-weight: 400;
        font-size: clamp(2rem, 5vw, 3rem); color: var(--text-primary);
        line-height: 1.15; margin-bottom: 0;
    }
    .tribute-owner { font-size: 0.92rem; color: var(--text-secondary); font-style: italic; }

    /* Meta + actions on one row */
    .tribute-info-row {
        display: flex; align-items: center; justify-content: center;
        flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
    }
    .tribute-info-row .meta-sep {
        width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); opacity: 0.5;
        flex-shrink: 0;
    }
    .tribute-meta-inline {
        display: flex; align-items: center; gap: 4px;
        font-size: 0.82rem; color: var(--text-secondary);
    }
    .tribute-meta-inline .icon { width: 13px; height: 13px; color: var(--primary-orange); }

    /* Reaction + action pills in one row */
    .tribute-interact-row {
        display: flex; align-items: center; justify-content: center;
        flex-wrap: wrap; gap: 6px; margin-bottom: 20px;
    }
    .reaction-btn {
        display: flex; align-items: center; justify-content: center;
        width: 36px; height: 36px; padding: 0;
        border-radius: 50%; border: 1.5px solid rgba(44,35,33,0.1); background: white;
        font-family: var(--font-body); font-weight: 700;
        font-size: 0.8rem; cursor: pointer; transition: all 0.2s ease;
        user-select: none; -webkit-user-select: none;
    }
    .reaction-btn.has-count {
        width: auto; height: 36px; padding: 0 12px;
        border-radius: 9999px; gap: 5px;
    }
    .reaction-btn:hover { border-color: rgba(44,35,33,0.2); background: rgba(44,35,33,0.02); transform: translateY(-1px); }
    .reaction-btn:active { transform: scale(0.95); }
    .reaction-btn.reacted { border-color: var(--primary-orange); background: rgba(232, 112, 78, 0.06); }
    .reaction-btn.cooldown { opacity: 0.5; cursor: not-allowed; }
    .reaction-btn .reaction-emoji { width: 20px; height: 20px; display: block; flex-shrink: 0; }
    .reaction-btn .reaction-count { font-size: 0.78rem; text-align: center; color: var(--text-secondary); }
    .reaction-btn .reaction-count:empty { display: none; }
    @keyframes reaction-pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 70% { transform: scale(0.9); } 100% { transform: scale(1); } }
    .reaction-btn.pop .reaction-emoji { animation: reaction-pop 0.4s ease; }
    .interact-sep {
        width: 1px; height: 20px; background: rgba(44,35,33,0.1); flex-shrink: 0; margin: 0 2px;
    }

    /* Share modal */
    .share-overlay {
        position: fixed; inset: 0; z-index: 1500; background: rgba(0,0,0,0.4);
        display: none; align-items: center; justify-content: center; padding: 20px;
    }
    .share-overlay.visible { display: flex; }
    .share-modal {
        background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 340px;
        box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    }
    .share-modal-title {
        font-family: var(--font-heading); font-weight: 700; font-size: 1rem;
        margin-bottom: 16px; text-align: center; color: var(--text-primary);
    }
    .share-modal-options { display: flex; flex-direction: column; gap: 4px; }
    .share-option {
        display: flex; align-items: center; gap: 12px;
        padding: 12px 14px; border-radius: 10px; border: none; background: transparent;
        font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
        color: var(--text-primary); cursor: pointer; transition: background 0.12s;
        text-decoration: none; width: 100%; text-align: left;
    }
    .share-option:hover { background: rgba(44,35,33,0.04); }
    .share-option .icon { width: 20px; height: 20px; color: var(--text-secondary); flex-shrink: 0; }
    .share-option.copy-done { color: var(--accent-teal); }
    .share-option.copy-done .icon { color: var(--accent-teal); }
    .share-modal-close {
        display: block; margin: 12px auto 0; padding: 8px 20px; border-radius: 8px;
        border: 1px solid rgba(44,35,33,0.1); background: transparent;
        font-family: var(--font-body); font-size: 0.82rem; font-weight: 600;
        color: var(--text-muted); cursor: pointer; transition: background 0.12s;
    }
    .share-modal-close:hover { background: rgba(44,35,33,0.04); }
    body.tpl-eternal .share-modal { background: #2A2320; }
    body.tpl-eternal .share-modal-title { color: #E8DFD6; }
    body.tpl-eternal .share-option { color: #E8DFD6; }
    body.tpl-eternal .share-option:hover { background: rgba(255,255,255,0.04); }
    body.tpl-eternal .share-option .icon { color: #9B8E87; }
    body.tpl-eternal .share-modal-close { border-color: rgba(255,255,255,0.08); color: #9B8E87; }
    body.tpl-eternal .share-modal-close:hover { background: rgba(255,255,255,0.04); }

    /* Mural position mini-preview */
    .tribute-mural-preview {
        margin-bottom: 32px; text-align: center;
    }
    .tribute-mural-preview-title {
        font-family: var(--font-heading); font-weight: 700; font-size: 1rem;
        color: var(--text-primary); margin-bottom: 12px;
        display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .tribute-mural-preview-title .icon { width: 16px; height: 16px; color: var(--primary-orange); }
    .tribute-mural-mini {
        display: inline-block; border-radius: 10px; overflow: hidden;
        border: 2px solid var(--bg-accent); box-shadow: 0 2px 12px rgba(0,0,0,0.06);
        background: var(--bg-accent); position: relative;
    }
    .tribute-mural-mini canvas { display: block; }
    .tribute-mural-link {
        display: block; text-align: center; margin-top: 10px;
        font-size: 0.82rem; font-weight: 600; color: var(--accent-teal); text-decoration: none;
    }
    .tribute-mural-link:hover { color: var(--accent-teal-dark); }
    body.tpl-eternal .tribute-mural-preview-title { color: #9B8E87; }
    body.tpl-eternal .tribute-mural-preview-title .icon { color: #D4A03E; }
    body.tpl-eternal .tribute-mural-mini { border-color: rgba(255,255,255,0.06); background: #2A2320; }
    body.tpl-eternal .tribute-mural-link { color: #D4A03E; }

    /* Nearby location section (world map tab) */
    .tribute-area-pets { margin-bottom: 40px; }
    .tribute-area-pets-title {
        font-family: var(--font-heading); font-weight: 700; font-size: 1rem;
        text-align: center; margin-bottom: 16px; color: var(--text-primary);
    }
    body.tpl-eternal .tribute-area-pets-title { color: #9B8E87; }
    .tribute-action-btn {
        display: inline-flex; align-items: center; gap: 6px;
        padding: 9px 16px; border-radius: 10px;
        font-family: var(--font-body); font-weight: 600; font-size: 0.82rem;
        cursor: pointer; border: none; transition: background 0.15s, transform 0.1s; text-decoration: none;
    }
    .tribute-action-btn:active { transform: scale(0.97); }
    .tribute-action-btn .icon { width: 16px; height: 16px; }
    .tribute-action-primary { background: var(--primary-orange); color: #fff; }
    .tribute-action-primary:hover { background: var(--primary-orange-dark); }
    .tribute-action-secondary { background: rgba(44,35,33,0.06); color: var(--text-secondary); }
    .tribute-action-secondary:hover { background: rgba(44,35,33,0.1); }
    .tribute-action-teal { background: var(--accent-teal); color: #fff; }
    .tribute-action-teal:hover { background: var(--accent-teal-dark); }

    /* ================================================
       TAB BAR
       ================================================ */
    .tribute-tabs {
        display: flex; justify-content: center; gap: 0;
        border-bottom: 2px solid rgba(44,35,33,0.1);
        margin-bottom: 28px;
        padding-top: 4px;
    }
    .tribute-tab {
        padding: 11px 18px; border: none; background: transparent;
        font-family: var(--font-body); font-weight: 600; font-size: 0.85rem;
        color: var(--text-muted); cursor: pointer;
        border-bottom: 2.5px solid transparent; margin-bottom: -2px;
        transition: color 0.15s, border-color 0.15s;
        display: flex; align-items: center; gap: 6px;
    }
    .tribute-tab .icon { width: 16px; height: 16px; }
    .tribute-tab:hover { color: var(--text-secondary); }
    .tribute-tab.active { color: var(--primary-orange); border-bottom-color: var(--primary-orange); }
    .tribute-tab .tab-count {
        font-size: 0.72rem; font-weight: 700; background: rgba(44,35,33,0.08);
        padding: 2px 7px; border-radius: 9999px; min-width: 18px; text-align: center;
    }
    .tribute-tab.active .tab-count { background: rgba(232,112,78,0.12); color: var(--primary-orange); }
    body.tpl-eternal .tribute-tabs { border-bottom-color: rgba(255,255,255,0.06); }
    body.tpl-eternal .tribute-tab { color: #6B5E57; }
    body.tpl-eternal .tribute-tab:hover { color: #9B8E87; }
    body.tpl-eternal .tribute-tab.active { color: #D4A03E; border-bottom-color: #D4A03E; }
    body.tpl-eternal .tribute-tab .tab-count { background: rgba(255,255,255,0.06); }
    body.tpl-eternal .tribute-tab.active .tab-count { background: rgba(212,160,62,0.15); color: #D4A03E; }
    body.tpl-lavender .tribute-tab.active { color: var(--primary-orange-dark); }

    /* Tab panels */
    .tribute-tab-panel { display: none; }
    .tribute-tab-panel.active { display: block; }

    /* ================================================
       TAB: ABOUT (story, timeline, family)
       ================================================ */
    .tribute-divider { display: none; }
    .tribute-story {
        font-size: 1.02rem; line-height: 1.85; color: var(--text-secondary);
        text-align: center; max-width: 580px; margin: 0 auto 28px; white-space: pre-line;
    }
    .tribute-stats-row { display: flex; justify-content: center; gap: 20px; margin-bottom: 28px; }
    .tribute-stat { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text-muted); }
    .tribute-stat .icon { width: 14px; height: 14px; }
    .tribute-stat-num { font-weight: 700; color: var(--text-secondary); }

    /* Family */
    .tribute-family { margin-bottom: 40px; }
    .tribute-family-title {
        font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem;
        text-align: center; margin-bottom: 20px; color: var(--text-primary);
        display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .tribute-family-title .icon { width: 18px; height: 18px; color: var(--accent-teal); }
    .tribute-family-grid { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
    .tribute-family-card {
        display: flex; flex-direction: column; align-items: center;
        text-decoration: none; color: inherit; transition: transform 0.15s;
    }
    .tribute-family-card:hover { transform: translateY(-3px); }
    .tribute-family-photo {
        width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
        border: 3px solid var(--accent-teal); box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        display: block; background: var(--bg-accent);
    }
    .tribute-family-placeholder {
        width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--accent-teal);
        background: var(--bg-accent); display: flex; align-items: center; justify-content: center; color: var(--text-muted);
    }
    .tribute-family-placeholder .icon { width: 24px; height: 24px; }
    .tribute-family-name {
        margin-top: 8px; font-family: var(--font-body); font-weight: 700; font-size: 0.82rem;
        text-align: center; max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    /* Timeline */
    .tribute-timeline { margin-bottom: 40px; }
    .tribute-timeline-title {
        font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem;
        text-align: center; margin-bottom: 20px; color: var(--text-primary);
        display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .tribute-timeline-title .icon { width: 18px; height: 18px; color: var(--accent-teal); }
    .tribute-timeline-track { position: relative; padding-left: 28px; }
    .tribute-timeline-track::before {
        content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px;
        width: 2px; background: var(--bg-accent); border-radius: 2px;
    }
    .tribute-timeline-item { position: relative; padding-bottom: 20px; }
    .tribute-timeline-item:last-child { padding-bottom: 0; }
    .tribute-timeline-dot {
        position: absolute; left: -24px; top: 2px; width: 14px; height: 14px; border-radius: 50%;
        background: var(--accent-teal); border: 2px solid var(--bg-primary); z-index: 1;
    }
    .tribute-timeline-item.highlight .tribute-timeline-dot { background: var(--primary-orange); }
    .tribute-timeline-date {
        font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
        text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px;
    }
    .tribute-timeline-label {
        font-size: 0.9rem; font-weight: 600; color: var(--text-primary); line-height: 1.4;
    }
    .tribute-timeline-label .icon { width: 14px; height: 14px; display: inline; vertical-align: -2px; margin-right: 4px; }

    /* ================================================
       TAB: GALLERY
       ================================================ */
    .tribute-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .tribute-gallery-thumb {
        aspect-ratio: 1; border-radius: 12px; overflow: hidden; cursor: pointer;
        position: relative; background: var(--bg-accent); transition: transform 0.15s, box-shadow 0.15s;
    }
    .tribute-gallery-thumb:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
    .tribute-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .tribute-gallery-caption {
        position: absolute; bottom: 0; left: 0; right: 0;
        padding: 6px 10px; font-size: 0.72rem; font-weight: 600;
        color: #fff; background: linear-gradient(transparent, rgba(0,0,0,0.6));
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .tribute-gallery-empty {
        text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 0.9rem;
    }
    /* Lightbox */
    .tribute-lightbox {
        position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.88); display: none;
        align-items: center; justify-content: center; flex-direction: column; padding: 20px; cursor: pointer;
    }
    .tribute-lightbox.visible { display: flex; }
    .tribute-lightbox img {
        max-width: 90vw; max-height: 80vh; border-radius: 12px;
        object-fit: contain; box-shadow: 0 12px 48px rgba(0,0,0,0.5); cursor: default;
    }
    .tribute-lightbox-caption {
        margin-top: 12px; color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 600; text-align: center; max-width: 600px;
    }
    .tribute-lightbox-close {
        position: absolute; top: 16px; right: 20px; width: 36px; height: 36px; border-radius: 50%;
        background: rgba(255,255,255,0.12); border: none; color: #fff; cursor: pointer;
        display: flex; align-items: center; justify-content: center; transition: background 0.15s;
        padding: 0; line-height: 0;
    }
    .tribute-lightbox-close i, .tribute-lightbox-close svg { margin: 0 !important; display: block !important; }
    .tribute-lightbox-close:hover { background: rgba(255,255,255,0.25); }
    .tribute-lightbox-nav {
        position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
        background: rgba(255,255,255,0.12); border: none; color: #fff; cursor: pointer;
        display: flex; align-items: center; justify-content: center; transition: background 0.15s;
    }
    .tribute-lightbox-nav:hover { background: rgba(255,255,255,0.25); }
    .tribute-lightbox-nav.prev { left: 16px; }
    .tribute-lightbox-nav.next { right: 16px; }
    .tribute-lightbox-counter {
        position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
        color: rgba(255,255,255,0.5); font-size: 0.78rem; font-weight: 600;
    }

    /* Owner edit controls */
    .template-switcher .owner-save-template {
        display: none; margin-left: 6px; padding: 6px 14px; border-radius: 8px; border: none;
        background: var(--accent-teal); color: #fff; font-family: var(--font-body);
        font-weight: 700; font-size: 0.72rem; cursor: pointer; transition: background 0.15s;
        white-space: nowrap;
    }
    .template-switcher .owner-save-template.visible { display: inline-flex; align-items: center; gap: 4px; }
    .template-switcher .owner-save-template:hover { background: var(--accent-teal-dark); }
    .template-switcher .owner-save-template:disabled { opacity: 0.5; cursor: not-allowed; }
    .template-switcher .owner-save-template .icon { width: 12px; height: 12px; }
    .template-switcher .owner-save-template.saved { background: var(--accent-teal); }
    body.tpl-eternal .template-switcher .owner-save-template { background: #D4A03E; color: #1A1514; }
    body.tpl-eternal .template-switcher .owner-save-template:hover { background: #C4902E; }
    body.tpl-lavender .template-switcher .owner-save-template { border-radius: 9999px; background: #7C6B9E; color: #fff; }
    body.tpl-lavender .template-switcher .owner-save-template:hover { background: #6B5A8D; }
    body.tpl-ocean .template-switcher .owner-save-template { background: #3D7A8A; color: #fff; }
    body.tpl-ocean .template-switcher .owner-save-template:hover { background: #2D6A7A; }
    .tribute-story-edit-wrap { position: relative; }
    .tribute-story-edit-btn {
        display: none; position: absolute; top: -10px; right: -10px;
        padding: 7px 16px; border-radius: 50px; border: none;
        background: #358585; color: white; font-family: var(--font-body);
        font-weight: 700; font-size: 0.78rem; cursor: pointer; transition: all 0.2s;
        z-index: 2; box-shadow: 0 2px 8px rgba(53, 133, 133,0.3);
    }
    .tribute-story-edit-btn.visible { display: inline-flex; align-items: center; gap: 5px; }
    .tribute-story-edit-btn:hover { background: #2A6B6B; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(53, 133, 133,0.4); }
    .tribute-story-edit-btn .icon { width: 13px; height: 13px; }
    /* Editable indicator: dashed border around story when in owner mode */
    .tribute-story-edit-wrap.owner-active { border: 2px dashed rgba(53, 133, 133,0.25); border-radius: 12px; padding: 12px; margin: -12px -12px 16px; position: relative; }
    .tribute-story-edit-wrap.owner-active:hover { border-color: rgba(53, 133, 133,0.5); }
    .tribute-story-textarea {
        display: none; width: 100%; min-height: 120px; padding: 14px 18px; border-radius: 12px;
        border: 2px solid var(--primary-orange); font-family: var(--font-body); font-size: 1rem;
        line-height: 1.8; color: var(--text-secondary); background: #fff; resize: vertical;
        text-align: center; box-sizing: border-box; transition: border-color 0.15s;
    }
    .tribute-story-textarea:focus { outline: none; border-color: var(--accent-teal); }
    .tribute-story-textarea.visible { display: block; }
    .tribute-story-actions {
        display: none; justify-content: center; gap: 8px; margin-top: 10px; margin-bottom: 28px;
    }
    .tribute-story-actions.visible { display: flex; }
    .tribute-story-save {
        padding: 8px 18px; border-radius: 10px; border: none;
        background: var(--primary-orange); color: #fff; font-family: var(--font-body);
        font-weight: 700; font-size: 0.82rem; cursor: pointer; transition: background 0.15s;
        display: flex; align-items: center; gap: 6px;
    }
    .tribute-story-save:hover { background: var(--primary-orange-dark); }
    .tribute-story-save:disabled { opacity: 0.5; cursor: not-allowed; }
    .tribute-story-save .icon { width: 14px; height: 14px; }
    .tribute-story-cancel {
        padding: 8px 18px; border-radius: 10px; border: 1.5px solid rgba(44,35,33,0.1);
        background: transparent; color: var(--text-muted); font-family: var(--font-body);
        font-weight: 700; font-size: 0.82rem; cursor: pointer; transition: all 0.15s;
    }
    .tribute-story-cancel:hover { border-color: var(--primary-orange); color: var(--primary-orange); }
    .tribute-story-charlimit {
        text-align: center; font-size: 0.72rem; color: var(--text-muted); margin-top: 4px;
    }
    body.tpl-eternal .tribute-story-edit-btn { background: #D4A03E; color: #1A1514; box-shadow: 0 2px 8px rgba(212,160,62,0.3); }
    body.tpl-eternal .tribute-story-edit-btn:hover { background: #C4902E; box-shadow: 0 4px 12px rgba(212,160,62,0.4); }
    body.tpl-eternal .tribute-story-edit-wrap.owner-active { border-color: rgba(212,160,62,0.25); }
    body.tpl-eternal .tribute-story-edit-wrap.owner-active:hover { border-color: rgba(212,160,62,0.5); }
    body.tpl-eternal .tribute-story-textarea { background: rgba(255,255,255,0.04); border-color: #D4A03E; color: #B5A89E; }
    body.tpl-eternal .tribute-story-textarea:focus { border-color: #D4A03E; }
    body.tpl-eternal .tribute-story-save { background: #D4A03E; color: #1A1514; }
    body.tpl-eternal .tribute-story-save:hover { background: #C4902E; }
    body.tpl-eternal .tribute-story-cancel { border-color: rgba(255,255,255,0.08); color: #9B8E87; }
    body.tpl-lavender .tribute-story-save { border-radius: 9999px; }
    body.tpl-lavender .tribute-story-cancel { border-radius: 9999px; }
    body.tpl-lavender .tribute-story-edit-btn { border-radius: 9999px; }

    /* Gallery upload section */
    .gallery-upload-section {
        margin-top: 24px; padding: 20px; border-radius: 16px;
        background: rgba(44,35,33,0.03); border: 1px solid rgba(44,35,33,0.06);
    }
    .gallery-upload-title {
        font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem;
        color: var(--text-primary); margin-bottom: 4px;
        display: flex; align-items: center; gap: 8px;
    }
    .gallery-upload-title .icon { width: 16px; height: 16px; color: var(--primary-orange); }
    .gallery-upload-subtitle {
        font-size: 0.8rem; color: var(--text-muted); margin-bottom: 16px;
    }
    .gallery-upload-counter {
        font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
        margin-bottom: 12px;
    }
    .gallery-upload-counter span { color: var(--primary-orange); font-weight: 700; }
    /* Email verify step */
    .gallery-email-verified {
        display: none; align-items: center; gap: 6px;
        font-size: 0.82rem; font-weight: 600; color: var(--accent-teal); margin-bottom: 12px;
    }
    .gallery-email-verified.visible { display: flex; }
    .gallery-email-verified .icon { width: 16px; height: 16px; }
    /* Upload form (shown after email verified) */
    .gallery-upload-form { display: none; }
    .gallery-upload-form.visible { display: block; }
    .gallery-upload-dropzone {
        border: 2px dashed rgba(44,35,33,0.12); border-radius: 12px;
        padding: 24px; text-align: center; cursor: pointer;
        transition: border-color 0.15s, background 0.15s; margin-bottom: 12px;
        position: relative;
    }
    .gallery-upload-dropzone:hover { border-color: var(--primary-orange); background: rgba(232,112,78,0.03); }
    .gallery-upload-dropzone.dragover { border-color: var(--primary-orange); background: rgba(232,112,78,0.06); }
    .gallery-upload-dropzone.has-file { border-style: solid; border-color: var(--accent-teal); background: rgba(53, 133, 133,0.03); }
    .gallery-upload-dropzone .icon { width: 28px; height: 28px; color: var(--text-muted); margin-bottom: 8px; }
    .gallery-upload-dropzone p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
    .gallery-upload-dropzone .filename { font-weight: 700; color: var(--accent-teal); }
    .gallery-upload-dropzone input[type="file"] { display: none; }
    .gallery-upload-caption {
        width: 100%; padding: 10px 14px; border-radius: 10px;
        border: 1px solid rgba(44,35,33,0.1); font-family: var(--font-body); font-size: 0.88rem;
        background: #fff; color: var(--text-primary); margin-bottom: 12px;
        transition: border-color 0.15s; box-sizing: border-box;
    }
    .gallery-upload-caption:focus { outline: none; border-color: var(--primary-orange); }
    .gallery-upload-submit {
        display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px;
        border-radius: 10px; border: none; background: var(--primary-orange); color: #fff;
        font-family: var(--font-body); font-weight: 700; font-size: 0.85rem;
        cursor: pointer; transition: background 0.15s;
    }
    .gallery-upload-submit:hover { background: var(--primary-orange-dark); }
    .gallery-upload-submit:disabled { opacity: 0.5; cursor: not-allowed; }
    .gallery-upload-submit .icon { width: 16px; height: 16px; }
    .gallery-upload-status {
        font-size: 0.82rem; margin-top: 8px; display: none;
    }
    .gallery-upload-status.visible { display: block; }
    .gallery-upload-status.success { color: var(--accent-teal); }
    .gallery-upload-status.error { color: #c0392b; }
    .gallery-upload-full {
        text-align: center; padding: 12px; font-size: 0.85rem;
        color: var(--text-muted); font-weight: 600;
    }
    /* Delete button overlay on thumbnails */
    .gallery-delete-btn {
        position: absolute; top: 6px; right: 6px;
        width: 24px; height: 24px; border-radius: 50%;
        background: rgba(0,0,0,0.6); border: none; color: #fff;
        cursor: pointer; display: none; align-items: center; justify-content: center;
        transition: background 0.15s; z-index: 5; padding: 0; line-height: 0;
    }
    .gallery-delete-btn .icon { width: 14px; height: 14px; margin: 0 !important; display: block !important; }
    .gallery-delete-btn:hover { background: rgba(192,57,43,0.9); }
    .gallery-delete-btn .icon { width: 14px; height: 14px; }
    .tribute-gallery-thumb .gallery-delete-btn { display: none; }
    .gallery-owner-mode .tribute-gallery-thumb .gallery-delete-btn { display: flex; }
    .gallery-owner-mode .tribute-gallery-thumb:hover .gallery-delete-btn { display: flex; }
    /* Template overrides */
    body.tpl-lavender .gallery-upload-section { background: #fff; border: 2px solid rgba(44,35,33,0.06); border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
    body.tpl-lavender .gallery-upload-submit { border-radius: 9999px; }
    body.tpl-eternal .gallery-upload-section { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }
    body.tpl-eternal .gallery-upload-title { color: #E8DFD6; }
    body.tpl-eternal .gallery-upload-subtitle { color: #6B5E57; }
    body.tpl-eternal .gallery-upload-counter { color: #6B5E57; }
    body.tpl-eternal .gallery-upload-counter span { color: #D4A03E; }
    body.tpl-eternal .gallery-email-verified { color: #D4A03E; }
    body.tpl-eternal .gallery-upload-dropzone { border-color: rgba(255,255,255,0.08); }
    body.tpl-eternal .gallery-upload-dropzone:hover { border-color: #D4A03E; background: rgba(212,160,62,0.04); }
    body.tpl-eternal .gallery-upload-dropzone.has-file { border-color: #D4A03E; background: rgba(212,160,62,0.04); }
    body.tpl-eternal .gallery-upload-dropzone .icon { color: #6B5E57; }
    body.tpl-eternal .gallery-upload-dropzone p { color: #6B5E57; }
    body.tpl-eternal .gallery-upload-dropzone .filename { color: #D4A03E; }
    body.tpl-eternal .gallery-upload-caption { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: #E8DFD6; }
    body.tpl-eternal .gallery-upload-caption:focus { border-color: #D4A03E; }
    body.tpl-eternal .gallery-upload-submit { background: #D4A03E; color: #1A1514; }
    body.tpl-eternal .gallery-upload-submit:hover { background: #C4902E; }

    /* ================================================
       TAB: GUESTBOOK
       ================================================ */
    .tribute-guestbook-form {
        margin-bottom: 24px; padding: 20px; border-radius: 16px;
        background: rgba(44,35,33,0.03); border: 1px solid rgba(44,35,33,0.06);
    }
    .tribute-guestbook-form input,
    .tribute-guestbook-form textarea {
        display: block; width: 100%; padding: 10px 14px; border-radius: 10px;
        border: 1px solid rgba(44,35,33,0.1); font-family: var(--font-body); font-size: 0.88rem;
        background: #fff; color: var(--text-primary); margin-bottom: 10px; resize: vertical;
        transition: border-color 0.15s; box-sizing: border-box;
    }
    .tribute-guestbook-form input:focus,
    .tribute-guestbook-form textarea:focus { outline: none; border-color: var(--primary-orange); }
    .tribute-guestbook-form textarea { min-height: 80px; }
    .tribute-guestbook-form-row { display: flex; justify-content: space-between; align-items: center; }
    .tribute-guestbook-charlimit { font-size: 0.75rem; color: var(--text-muted); }
    .tribute-guestbook-submit {
        display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 10px; border: none;
        background: var(--primary-orange); color: #fff; font-family: var(--font-body); font-weight: 700;
        font-size: 0.85rem; cursor: pointer; transition: background 0.15s;
    }
    .tribute-guestbook-submit:hover { background: var(--primary-orange-dark); }
    .tribute-guestbook-submit:disabled { opacity: 0.5; cursor: not-allowed; }
    .tribute-guestbook-submit .icon { width: 16px; height: 16px; }
    .tribute-guestbook-error { font-size: 0.82rem; color: #c0392b; margin-top: 6px; display: none; }
    .tribute-guestbook-error.visible { display: block; }
    .tribute-guestbook-msg { padding: 14px 0; border-bottom: 1px solid rgba(44,35,33,0.06); }
    .tribute-guestbook-msg:last-child { border-bottom: none; }
    .tribute-guestbook-msg-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
    .tribute-guestbook-msg-author { font-weight: 700; font-size: 0.88rem; color: var(--text-primary); }
    .tribute-guestbook-msg-date { font-size: 0.75rem; color: var(--text-muted); }
    .tribute-guestbook-msg-body { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; white-space: pre-line; }
    .tribute-guestbook-messages { padding-bottom: 24px; }
    .tribute-guestbook-empty { text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.88rem; }
    .tribute-guestbook-more {
        display: block; margin: 16px auto 0; padding: 8px 20px; border-radius: 10px;
        border: 1px solid rgba(44,35,33,0.1); background: transparent; color: var(--text-secondary);
        font-family: var(--font-body); font-weight: 600; font-size: 0.82rem; cursor: pointer; transition: background 0.15s;
    }
    .tribute-guestbook-more:hover { background: rgba(44,35,33,0.04); }

    /* ================================================
       TAB: UPDATES (owner life updates)
       ================================================ */
    .tribute-updates-section { margin-bottom: 32px; }
    .tribute-updates-title {
        font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem;
        text-align: center; margin-bottom: 16px; color: var(--text-primary);
        display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .tribute-updates-title .icon { width: 18px; height: 18px; color: var(--primary-orange); }
    .tribute-updates-list { margin-bottom: 20px; }
    .tribute-update-item {
        padding: 16px 0; border-bottom: 1px solid rgba(44,35,33,0.06);
    }
    .tribute-update-item:last-child { border-bottom: none; }
    .tribute-update-header {
        display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
    }
    .tribute-update-date { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
    .tribute-update-delete {
        display: none; padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(44,35,33,0.1);
        background: transparent; color: var(--text-muted); cursor: pointer; font-size: 0.7rem;
        font-weight: 600; font-family: var(--font-body); transition: all 0.15s;
    }
    .tribute-update-delete:hover { border-color: #c0392b; color: #c0392b; }
    .tribute-update-delete .icon { width: 12px; height: 12px; }
    .updates-owner-mode .tribute-update-delete { display: inline-flex; align-items: center; gap: 3px; }
    .tribute-update-body {
        font-size: 0.92rem; color: var(--text-secondary); line-height: 1.7; white-space: pre-line;
    }
    .tribute-updates-empty {
        text-align: center; padding: 30px 20px; color: var(--text-muted); font-size: 0.88rem;
    }
    .tribute-updates-form {
        padding: 16px; border-radius: 14px; margin-bottom: 20px;
        background: rgba(44,35,33,0.03); border: 1px solid rgba(44,35,33,0.06);
        display: none;
    }
    .tribute-updates-form.visible { display: block; }
    .tribute-updates-form textarea {
        display: block; width: 100%; padding: 10px 14px; border-radius: 10px;
        border: 1px solid rgba(44,35,33,0.1); font-family: var(--font-body); font-size: 0.88rem;
        background: #fff; color: var(--text-primary); margin-bottom: 8px; resize: vertical;
        min-height: 70px; transition: border-color 0.15s; box-sizing: border-box;
    }
    .tribute-updates-form textarea:focus { outline: none; border-color: var(--primary-orange); }
    .tribute-updates-form-row { display: flex; justify-content: space-between; align-items: center; }
    .tribute-updates-charlimit { font-size: 0.72rem; color: var(--text-muted); }
    .tribute-updates-submit {
        display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 10px; border: none;
        background: var(--primary-orange); color: #fff; font-family: var(--font-body); font-weight: 700;
        font-size: 0.82rem; cursor: pointer; transition: background 0.15s;
    }
    .tribute-updates-submit:hover { background: var(--primary-orange-dark); }
    .tribute-updates-submit:disabled { opacity: 0.5; cursor: not-allowed; }
    .tribute-updates-submit .icon { width: 14px; height: 14px; }
    .tribute-updates-error { font-size: 0.8rem; color: #c0392b; margin-top: 6px; display: none; }
    .tribute-updates-error.visible { display: block; }
    .tribute-updates-more {
        display: block; margin: 12px auto 0; padding: 8px 18px; border-radius: 10px;
        border: 1px solid rgba(44,35,33,0.1); background: transparent; color: var(--text-secondary);
        font-family: var(--font-body); font-weight: 600; font-size: 0.82rem; cursor: pointer; transition: background 0.15s;
    }
    .tribute-updates-more:hover { background: rgba(44,35,33,0.04); }
    /* Playful overrides */
    body.tpl-lavender .tribute-updates-form { background: #fff; border: 2px solid rgba(44,35,33,0.06); border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
    body.tpl-lavender .tribute-updates-submit { border-radius: 9999px; }
    /* Memorial overrides */
    body.tpl-eternal .tribute-updates-title { color: #9B8E87; }
    body.tpl-eternal .tribute-updates-title .icon { color: #D4A03E; }
    body.tpl-eternal .tribute-update-item { border-bottom-color: rgba(255,255,255,0.04); }
    body.tpl-eternal .tribute-update-date { color: #6B5E57; }
    body.tpl-eternal .tribute-update-body { color: #9B8E87; }
    body.tpl-eternal .tribute-updates-empty { color: #6B5E57; }
    body.tpl-eternal .tribute-updates-form { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }
    body.tpl-eternal .tribute-updates-form textarea { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: #E8DFD6; }
    body.tpl-eternal .tribute-updates-form textarea:focus { border-color: #D4A03E; }
    body.tpl-eternal .tribute-updates-submit { background: #D4A03E; color: #1A1514; }
    body.tpl-eternal .tribute-updates-submit:hover { background: #C4902E; }
    body.tpl-eternal .tribute-update-delete { border-color: rgba(255,255,255,0.08); color: #6B5E57; }
    body.tpl-eternal .tribute-update-delete:hover { border-color: #E07A5F; color: #E07A5F; }
    body.tpl-eternal .tribute-updates-more { border-color: rgba(255,255,255,0.06); color: #9B8E87; }
    body.tpl-eternal .tribute-updates-more:hover { background: rgba(255,255,255,0.04); }

    /* ================================================
       TAB: MURAL (map, nearby)
       ================================================ */
    .tribute-map-section { margin-bottom: 40px; }
    .tribute-map-title {
        font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem;
        text-align: center; margin-bottom: 16px; color: var(--text-primary);
        display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .tribute-map-title .icon { width: 18px; height: 18px; color: var(--accent-teal); }
    .tribute-map-container {
        width: 100%; height: 220px; border-radius: 16px; overflow: hidden;
        border: 2px solid var(--bg-accent); box-shadow: var(--shadow-sm);
        position: relative; background: var(--bg-accent);
    }
    .tribute-map-container img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .tribute-map-link {
        display: block; text-align: center; margin-top: 10px;
        font-size: 0.82rem; font-weight: 600; color: var(--accent-teal); text-decoration: none;
    }
    .tribute-map-link:hover { color: var(--accent-teal-dark); }

    .tribute-nearby { margin-bottom: 40px; }
    .tribute-nearby-title {
        font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem;
        text-align: center; margin-bottom: 20px; color: var(--text-primary);
    }
    .tribute-nearby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
    .tribute-neighbor-card {
        display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
        background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
        transition: transform 0.15s, box-shadow 0.15s; text-decoration: none; color: inherit;
    }
    .tribute-neighbor-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,0.1); }
    .tribute-neighbor-photo { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--bg-accent); }
    .tribute-neighbor-photo-placeholder {
        width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
        background: var(--bg-accent); color: var(--text-muted);
    }
    .tribute-neighbor-photo-placeholder .icon { width: 24px; height: 24px; }
    .tribute-neighbor-name {
        padding: 10px 12px; font-family: var(--font-body); font-weight: 700;
        font-size: 0.82rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }

    /* CTA */
    .tribute-cta-section {
        text-align: center; padding: 40px 20px; background: var(--bg-secondary);
        border-radius: 20px; margin-top: 48px;
    }
    .tribute-cta-title {
        font-family: 'DM Serif Display', Georgia, serif; font-weight: 400;
        font-size: 1.5rem; margin-bottom: 8px; color: var(--text-primary);
    }
    .tribute-cta-subtitle {
        font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 20px;
        max-width: 400px; margin-left: auto; margin-right: auto;
    }
    .tribute-cta-btn {
        display: inline-flex; align-items: center; gap: 8px;
        padding: 14px 28px; background: var(--primary-orange); color: #fff;
        border-radius: 9999px; font-family: var(--font-body); font-weight: 700; font-size: 0.9rem;
        text-decoration: none; box-shadow: 0 4px 20px rgba(232,112,78,0.3);
        transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    }
    .tribute-cta-btn:hover { background: var(--primary-orange-dark); box-shadow: 0 6px 28px rgba(232,112,78,0.4); transform: translateY(-1px); }
    .tribute-cta-btn .icon { width: 18px; height: 18px; }

    /* ================================================
       PLAYFUL TEMPLATE OVERRIDES
       ================================================ */
    body.tpl-lavender .tribute-hero { border-radius: 28px; box-shadow: 0 12px 40px rgba(232,112,78,0.15), 0 4px 12px rgba(0,0,0,0.06); border: 3px solid #fff; }
    body.tpl-lavender .tribute-occasion-badge { background: var(--primary-orange); backdrop-filter: none; font-size: 0.82rem; padding: 7px 16px; border-radius: 12px; box-shadow: 0 2px 8px rgba(232,112,78,0.3); }
    body.tpl-lavender .tribute-occasion-badge.memorial { background: var(--accent-teal); }
    body.tpl-lavender .tribute-pet-name { font-family: var(--font-heading); font-weight: 800; color: var(--primary-orange-dark); font-size: clamp(2rem, 5vw, 2.8rem); }
    body.tpl-lavender .tribute-owner { font-style: normal; font-weight: 600; color: var(--accent-teal); }
    body.tpl-lavender .tribute-meta-inline { font-weight: 600; }
    body.tpl-lavender .tribute-occasion-label { color: var(--primary-orange); }
    body.tpl-lavender .tribute-divider { width: 40px; height: 4px; border-radius: 4px; background: linear-gradient(135deg, var(--primary-orange), var(--primary-orange-light)); }
    body.tpl-lavender .tribute-story { background: #fff; padding: 28px 32px; border-radius: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); text-align: left; max-width: 100%; font-size: 1rem; line-height: 1.8; }
    body.tpl-lavender .reaction-btn { box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
    body.tpl-lavender .reaction-btn.reacted { box-shadow: 0 2px 8px rgba(232,112,78,0.15); }
    body.tpl-lavender .tribute-action-btn { border-radius: 9999px; }
    body.tpl-lavender .tribute-action-primary { background: linear-gradient(135deg, var(--primary-orange), #E0956E); box-shadow: 0 3px 12px rgba(232,112,78,0.25); }
    body.tpl-lavender .tribute-action-secondary { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
    body.tpl-lavender .tribute-gallery-thumb { border-radius: 16px; border: 2px solid #fff; }
    body.tpl-lavender .tribute-neighbor-card { border-radius: 20px; border: 2px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
    body.tpl-lavender .tribute-guestbook-form { background: #fff; border: 2px solid rgba(44,35,33,0.06); border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
    body.tpl-lavender .tribute-guestbook-submit { border-radius: 9999px; }
    body.tpl-lavender .tribute-cta-section { background: linear-gradient(135deg, #FFF0E8, #FFE8DC); border-radius: 28px; border: 2px solid rgba(232,112,78,0.1); }
    body.tpl-lavender .tribute-cta-btn { box-shadow: 0 6px 24px rgba(232,112,78,0.35); }
    body.tpl-lavender .tribute-timeline-track { padding-left: 32px; }
    body.tpl-lavender .tribute-timeline-dot { width: 16px; height: 16px; left: -28px; }
    body.tpl-lavender .tribute-timeline-label { font-weight: 700; }
    body.tpl-lavender .tribute-stats-row { background: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); width: fit-content; margin-left: auto; margin-right: auto; margin-bottom: 28px; }

    /* ================================================
       MEMORIAL TEMPLATE OVERRIDES
       ================================================ */
    body.tpl-eternal .tribute-hero { border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.06); }
    body.tpl-eternal .tribute-hero-placeholder { background: linear-gradient(145deg, #2A2320, #1A1514); color: rgba(255,255,255,0.15); }
    body.tpl-eternal .tribute-occasion-badge { background: rgba(212,160,62,0.7); backdrop-filter: blur(8px); }
    body.tpl-eternal .tribute-occasion-badge.memorial { background: rgba(212,160,62,0.7); }
    body.tpl-eternal .tribute-occasion-label { color: #D4A03E; }
    body.tpl-eternal .tribute-pet-name { color: #FFEEE6; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
    body.tpl-eternal .tribute-owner { color: #9B8E87; }
    body.tpl-eternal .tribute-meta-inline { color: #9B8E87; }
    body.tpl-eternal .tribute-meta-inline .icon { color: #D4A03E; }
    body.tpl-eternal .tribute-info-row .meta-sep { background: #6B5E57; }
    body.tpl-eternal .interact-sep { background: rgba(255,255,255,0.08); }
    body.tpl-eternal .tribute-divider { background: linear-gradient(90deg, transparent, #D4A03E, transparent); width: 100px; height: 1px; }
    body.tpl-eternal .tribute-story { color: #B5A89E; font-size: 1.05rem; line-height: 1.9; }
    body.tpl-eternal .tribute-stat { color: #6B5E57; }
    body.tpl-eternal .tribute-stat-num { color: #9B8E87; }
    body.tpl-eternal .reaction-btn { border-color: rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); }
    body.tpl-eternal .reaction-btn:hover { border-color: rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); }
    body.tpl-eternal .reaction-btn.reacted { border-color: #D4A03E; background: rgba(212,160,62,0.08); }
    body.tpl-eternal .reaction-btn .reaction-count { color: #9B8E87; }
    body.tpl-eternal .tribute-action-primary { background: #D4A03E; color: #1A1514; }
    body.tpl-eternal .tribute-action-primary:hover { background: #C4902E; }
    body.tpl-eternal .tribute-action-secondary { background: rgba(255,255,255,0.06); color: #9B8E87; }
    body.tpl-eternal .tribute-action-secondary:hover { background: rgba(255,255,255,0.1); color: #E8DFD6; }
    body.tpl-eternal .tribute-action-teal { background: rgba(53, 133, 133,0.4); }
    body.tpl-eternal .tribute-action-teal:hover { background: rgba(53, 133, 133,0.6); }
    body.tpl-eternal .tribute-nearby-title { color: #9B8E87; }
    body.tpl-eternal .tribute-neighbor-card { background: #2A2320; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
    body.tpl-eternal .tribute-neighbor-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.5); }
    body.tpl-eternal .tribute-neighbor-photo-placeholder { background: #2A2320; color: rgba(255,255,255,0.1); }
    body.tpl-eternal .tribute-neighbor-name { color: #B5A89E; }
    body.tpl-eternal .tribute-family-title { color: #9B8E87; }
    body.tpl-eternal .tribute-family-title .icon { color: #D4A03E; }
    body.tpl-eternal .tribute-family-photo { border-color: #D4A03E; }
    body.tpl-eternal .tribute-family-placeholder { border-color: #D4A03E; background: #2A2320; }
    body.tpl-eternal .tribute-family-name { color: #B5A89E; }
    body.tpl-eternal .tribute-timeline-title { color: #9B8E87; }
    body.tpl-eternal .tribute-timeline-title .icon { color: #D4A03E; }
    body.tpl-eternal .tribute-timeline-track::before { background: rgba(255,255,255,0.06); }
    body.tpl-eternal .tribute-timeline-dot { background: #D4A03E; border-color: #1A1514; }
    body.tpl-eternal .tribute-timeline-item.highlight .tribute-timeline-dot { background: #D4A03E; }
    body.tpl-eternal .tribute-timeline-date { color: #6B5E57; }
    body.tpl-eternal .tribute-timeline-label { color: #B5A89E; }
    body.tpl-eternal .tribute-gallery-title { color: #9B8E87; }
    body.tpl-eternal .tribute-gallery-title .icon { color: #D4A03E; }
    body.tpl-eternal .tribute-gallery-thumb { border: 1px solid rgba(255,255,255,0.06); }
    body.tpl-eternal .tribute-map-title { color: #9B8E87; }
    body.tpl-eternal .tribute-map-title .icon { color: #D4A03E; }
    body.tpl-eternal .tribute-map-container { border-color: rgba(255,255,255,0.06); }
    body.tpl-eternal .tribute-map-link { color: #D4A03E; }
    body.tpl-eternal .tribute-guestbook-form { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.06); }
    body.tpl-eternal .tribute-guestbook-form input,
    body.tpl-eternal .tribute-guestbook-form textarea { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: #E8DFD6; }
    body.tpl-eternal .tribute-guestbook-form input:focus,
    body.tpl-eternal .tribute-guestbook-form textarea:focus { border-color: #D4A03E; }
    body.tpl-eternal .tribute-guestbook-submit { background: #D4A03E; color: #1A1514; }
    body.tpl-eternal .tribute-guestbook-submit:hover { background: #C4902E; }
    body.tpl-eternal .tribute-guestbook-msg { border-bottom-color: rgba(255,255,255,0.04); }
    body.tpl-eternal .tribute-guestbook-msg-author { color: #E8DFD6; }
    body.tpl-eternal .tribute-guestbook-msg-date { color: #6B5E57; }
    body.tpl-eternal .tribute-guestbook-msg-body { color: #9B8E87; }
    body.tpl-eternal .tribute-guestbook-empty { color: #6B5E57; }
    body.tpl-eternal .tribute-guestbook-more { border-color: rgba(255,255,255,0.06); color: #9B8E87; }
    body.tpl-eternal .tribute-guestbook-more:hover { background: rgba(255,255,255,0.04); }
    body.tpl-eternal .tribute-guestbook-charlimit { color: #6B5E57; }
    body.tpl-eternal .tribute-gallery-empty { color: #6B5E57; }
    body.tpl-eternal .tribute-cta-section { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); }
    body.tpl-eternal .tribute-cta-title { color: #E8DFD6; }
    body.tpl-eternal .tribute-cta-subtitle { color: #9B8E87; }
    body.tpl-eternal .tribute-cta-btn { background: #D4A03E; color: #1A1514; box-shadow: 0 4px 20px rgba(212,160,62,0.25); }
    body.tpl-eternal .tribute-cta-btn:hover { background: #C4902E; box-shadow: 0 6px 28px rgba(212,160,62,0.35); }
    body.tpl-eternal .tribute-toast { background: #D4A03E; color: #1A1514; }
    body.tpl-eternal .navbar { background: rgba(26,21,20,0.95) !important; backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important; border-bottom: 1px solid rgba(250,245,240,0.06) !important; }
    body.tpl-eternal .footer { background: rgba(26,21,20,0.98) !important; }

    /* ================================================
       RESPONSIVE
       ================================================ */
    @media (max-width: 600px) {
        .tribute-content { padding: 72px 16px 40px; }
        .owner-verify-row { flex-direction: column !important; }
        .owner-verify-row button { width: 100%; }
        .tribute-hero img { max-height: 320px; }
        .tribute-meta { flex-direction: column; align-items: center; gap: 8px; }
        .tribute-story { font-size: 0.95rem; }
        body.tpl-classic .tribute-story { text-align: left; }
        .tribute-actions { flex-direction: column; align-items: stretch; }
        .tribute-action-btn { justify-content: center; }
        .tribute-nearby-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
        .template-switcher { flex-wrap: wrap; }
        .tribute-gallery-grid { grid-template-columns: repeat(2, 1fr); }
        .tribute-tabs { gap: 0; }
        .tribute-tab { padding: 10px 12px; font-size: 0.8rem; }
        .tribute-tab .icon { display: none; }
    }

    /* ================================================
       LAVENDER TEMPLATE - Soft purple, rounded, playful
       ================================================ */
    body.tpl-lavender { background: #EDE8F5; color: #2D2055; }
    body.tpl-lavender .tribute-content { max-width: 680px; }
    body.tpl-lavender .tribute-pet-name { color: #2D2055; font-family: 'Quicksand', sans-serif; font-weight: 800; }
    body.tpl-lavender .tribute-owner { color: #6B5CA5; }
    body.tpl-lavender .tribute-occasion-label { background: rgba(123,104,200,0.12); color: #6B5CA5; }
    body.tpl-lavender .tribute-hero img { border-radius: 20px; border: 4px solid #fff; }
    body.tpl-lavender .tribute-info-row .meta-sep { color: #B8ADE0; }
    body.tpl-lavender .tribute-info-row { color: #6B5CA5; }
    body.tpl-lavender .tribute-tabs { border-bottom-color: #D6CEF0; }
    body.tpl-lavender .tribute-tab { color: #6B5CA5; border-radius: 20px; }
    body.tpl-lavender .tribute-tab:hover { background: rgba(123,104,200,0.08); }
    body.tpl-lavender .tribute-tab.active { background: #7B68C8; color: #fff; border-bottom-color: transparent; border-radius: 20px; }
    body.tpl-lavender .tribute-story { color: #3D3066; background: #FAF8FF; border-radius: 16px; padding: 20px; border: 1.5px solid #E5DDF5; }
    body.tpl-lavender .tribute-divider { background: #D6CEF0; }
    body.tpl-lavender .tribute-action-btn { background: #7B68C8; color: #fff; border-radius: 20px; }
    body.tpl-lavender .tribute-action-btn:hover { background: #6B5AB8; }
    body.tpl-lavender .tribute-action-secondary { background: rgba(123,104,200,0.1); color: #6B5CA5; }
    body.tpl-lavender .tribute-action-secondary:hover { background: rgba(123,104,200,0.18); }
    body.tpl-lavender .tribute-reaction-btn { background: rgba(123,104,200,0.08); border-color: #D6CEF0; }
    body.tpl-lavender .tribute-reaction-btn:hover { background: rgba(123,104,200,0.15); }
    body.tpl-lavender .tribute-reaction-btn.active { background: rgba(123,104,200,0.18); border-color: #7B68C8; }
    body.tpl-lavender .share-modal { background: #FAF8FF; border: 1.5px solid #E5DDF5; }
    body.tpl-lavender .share-modal-title { color: #2D2055; }
    body.tpl-lavender .share-option { color: #3D3066; }
    body.tpl-lavender .share-option:hover { background: rgba(123,104,200,0.06); }
    body.tpl-lavender .tribute-family-card,
    body.tpl-lavender .tribute-neighbor-card { background: #FAF8FF; border-color: #E5DDF5; border-radius: 16px; }
    body.tpl-lavender .tribute-family-name,
    body.tpl-lavender .tribute-neighbor-name { color: #2D2055; }
    body.tpl-lavender .tribute-guestbook-msg { background: #FAF8FF; border-color: #E5DDF5; border-radius: 16px; }
    body.tpl-lavender .tribute-guestbook-msg-author { color: #6B5CA5; }
    body.tpl-lavender .tribute-guestbook-msg-body { color: #3D3066; }
    body.tpl-lavender .tribute-guestbook-submit { background: #7B68C8; color: #fff; border-radius: 20px; }
    body.tpl-lavender .tribute-guestbook-submit:hover { background: #6B5AB8; }
    body.tpl-lavender input[type="text"],
    body.tpl-lavender textarea { background: #FAF8FF; border-color: #D6CEF0; color: #2D2055; border-radius: 12px; }
    body.tpl-lavender input[type="text"]:focus,
    body.tpl-lavender textarea:focus { border-color: #7B68C8; }
    body.tpl-lavender .tribute-updates-section { background: #FAF8FF; border-color: #E5DDF5; border-radius: 16px; }
    body.tpl-lavender .tribute-updates-title { color: #6B5CA5; }
    body.tpl-lavender .tribute-mural-preview { border-radius: 16px; border-color: #E5DDF5; }
    body.tpl-lavender .template-switcher { background: rgba(123,104,200,0.06); }
    body.tpl-lavender .template-switcher button { color: #6B5CA5; }
    body.tpl-lavender .template-switcher button.active { background: #7B68C8; color: #fff; }
    body.tpl-lavender .template-switcher button:hover { background: rgba(123,104,200,0.1); }
    body.tpl-lavender .tribute-gallery-item { border-radius: 16px; }
    body.tpl-lavender .tab-count { background: #7B68C8; }


    /* ================================================
       OCEAN TEMPLATE - Clean blue, airy, serene
       ================================================ */
    body.tpl-ocean { background: #E8F1F8; color: #1A2D42; }
    body.tpl-ocean .tribute-content { max-width: 680px; }
    body.tpl-ocean .tribute-pet-name { color: #1A2D42; }
    body.tpl-ocean .tribute-owner { color: #4A6D8C; }
    body.tpl-ocean .tribute-occasion-label { background: rgba(43,108,176,0.1); color: #2B6CB0; }
    body.tpl-ocean .tribute-hero img { border-radius: 12px; border: 4px solid #fff; box-shadow: 0 2px 12px rgba(43,108,176,0.1); }
    body.tpl-ocean .tribute-info-row .meta-sep { color: #B0C9DE; }
    body.tpl-ocean .tribute-info-row { color: #4A6D8C; }
    body.tpl-ocean .tribute-tabs { border-bottom-color: #C8DBE8; }
    body.tpl-ocean .tribute-tab { color: #4A6D8C; }
    body.tpl-ocean .tribute-tab:hover { background: rgba(43,108,176,0.06); }
    body.tpl-ocean .tribute-tab.active { color: #2B6CB0; border-bottom-color: #2B6CB0; }
    body.tpl-ocean .tribute-story { color: #2D4A5E; background: #F7FAFC; border-radius: 12px; padding: 20px; border: 1.5px solid #D4E4F0; }
    body.tpl-ocean .tribute-divider { background: #C8DBE8; }
    body.tpl-ocean .tribute-action-btn { background: #2B6CB0; color: #fff; }
    body.tpl-ocean .tribute-action-btn:hover { background: #245BA0; }
    body.tpl-ocean .tribute-action-secondary { background: rgba(43,108,176,0.08); color: #2B6CB0; }
    body.tpl-ocean .tribute-action-secondary:hover { background: rgba(43,108,176,0.15); }
    body.tpl-ocean .tribute-reaction-btn { background: rgba(43,108,176,0.06); border-color: #C8DBE8; }
    body.tpl-ocean .tribute-reaction-btn:hover { background: rgba(43,108,176,0.12); }
    body.tpl-ocean .tribute-reaction-btn.active { background: rgba(43,108,176,0.15); border-color: #2B6CB0; }
    body.tpl-ocean .share-modal { background: #F7FAFC; border: 1.5px solid #D4E4F0; }
    body.tpl-ocean .share-modal-title { color: #1A2D42; }
    body.tpl-ocean .share-option { color: #2D4A5E; }
    body.tpl-ocean .share-option:hover { background: rgba(43,108,176,0.05); }
    body.tpl-ocean .tribute-family-card,
    body.tpl-ocean .tribute-neighbor-card { background: #F7FAFC; border-color: #D4E4F0; }
    body.tpl-ocean .tribute-family-name,
    body.tpl-ocean .tribute-neighbor-name { color: #1A2D42; }
    body.tpl-ocean .tribute-guestbook-msg { background: #F7FAFC; border-color: #D4E4F0; }
    body.tpl-ocean .tribute-guestbook-msg-author { color: #2B6CB0; }
    body.tpl-ocean .tribute-guestbook-msg-body { color: #2D4A5E; }
    body.tpl-ocean .tribute-guestbook-submit { background: #2B6CB0; color: #fff; }
    body.tpl-ocean .tribute-guestbook-submit:hover { background: #245BA0; }
    body.tpl-ocean input[type="text"],
    body.tpl-ocean textarea { background: #F7FAFC; border-color: #C8DBE8; color: #1A2D42; }
    body.tpl-ocean input[type="text"]:focus,
    body.tpl-ocean textarea:focus { border-color: #2B6CB0; }
    body.tpl-ocean .tribute-updates-section { background: #F7FAFC; border-color: #D4E4F0; }
    body.tpl-ocean .tribute-updates-title { color: #2B6CB0; }
    body.tpl-ocean .tribute-mural-preview { border-color: #D4E4F0; }
    body.tpl-ocean .template-switcher { background: rgba(43,108,176,0.05); }
    body.tpl-ocean .template-switcher button { color: #4A6D8C; }
    body.tpl-ocean .template-switcher button.active { background: #2B6CB0; color: #fff; }
    body.tpl-ocean .template-switcher button:hover { background: rgba(43,108,176,0.08); }
    body.tpl-ocean .tribute-gallery-item { border-radius: 12px; }
    body.tpl-ocean .tab-count { background: #2B6CB0; }
    body.tpl-ocean .tribute-not-found h2 { color: #1A2D42; }
    body.tpl-ocean .tribute-not-found p { color: #4A6D8C; }
    body.tpl-ocean .tribute-loading-text { color: #4A6D8C; }
    body.tpl-ocean .tribute-loading-spinner { border-color: rgba(43,108,176,0.1); border-top-color: #2B6CB0; }

