/* ====================================
   CSS Variables & Foundation
   ==================================== */

:root {
    /* Colors — matched to Figma styleguide */
    --bg-cream: #F1F2EC;
    /* Figma bg-light / welcome bg */
    --bg-light-cream: #F1F2EC;
    --btn-sage: #8C8F7A;
    /* main-button-color */
    --btn-sage-hover: #7A7D6A;
    --text-dark: #11142D;
    /* lighttext-colortitle */
    --text-muted: #6B5E53;
    /* brown body text */
    --footer-bg: #6B5E53;
    /* footer brown */
    --border-color: #8C8F7A;
    /* strok-card */
    --card-stroke: rgba(229, 222, 212, 1);
    /* strok-card */
    --stroke: rgba(230, 234, 237, 1);
    /* stroke */
    --drop-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.08);

    /* Typography */
    --font-serif: 'Playfair Display', 'Georgia', serif;
    --font-sans: 'Inter', 'Segoe UI', sans-serif;
    --font-lora: 'Playfair Display', serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Transitions */
    --transition: all 0.3s ease-in-out;
}

/* ====================================
   Global Styles
   ==================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background-color: var(--bg-cream);
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--text-dark);
}

a {
    color: var(--text-dark);
    transition: var(--transition);
}

/* ====================================
   Hero Section — Figma Welcome Screen
   ==================================== */

.hero-section {
    background-color: var(--bg-cream);
    overflow: hidden;
    min-height: 100vh;
}

/* Left column: full-bleed image, no padding, no rounding */
.hero-image-col {
    padding: 0;
    overflow: hidden;
    min-height: 100vh;
    position: relative;
}

.hero-image-wrapper {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* The actual <img> fills the full left panel */
.hero-image {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Fallback gradient shown when hero image file is missing */
.hero-image-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background: linear-gradient(160deg, #D8DDCE 0%, #C9CEBD 40%, #B8BEA6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image-placeholder svg {
    opacity: 0.4;
    width: 120px;
    height: 120px;
}

/* Right column: content area — footer lives inside at the bottom */
.hero-content-col {
    background-color: var(--bg-cream);
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
}

/* Scrollable inner content — fills all space above the footer */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl) var(--spacing-xl);
    max-width: 100%;
    width: 100%;
    text-align: center;
}

/* Footer anchored to the bottom of the right column */
.hero-content-col>.footer {
    flex-shrink: 0;
    width: 100%;
    margin: 0 !important;
}

/* Auth / register column — left-aligned form, matches onboarding layout */
.auth-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-xl);
    max-width: 100%;
    width: 100%;
    text-align: left;
}

.auth-content .logo-container {
    justify-content: flex-start;
}

.auth-content .hero-title {
    text-align: left;
}

.auth-content .hero-subtitle {
    text-align: left;
}

/* ====================================
   Logo
   ==================================== */

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

/* Actual PNG logo */
.logo-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    /* If PNG has dark/black background, clip to circle */
    border-radius: 50%;
    display: block;
}

/* Text fallback (no image file) */
.logo-text-fallback {
    font-family: var(--font-serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 1px;
}

/* Navbar brand text logo */
.logo-text {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 1px;
}

/* ====================================
   Hero Text
   ==================================== */

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(22px, 2.2vw, 36px);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    line-height: 1.75;
    font-weight: 400;
    letter-spacing: 0.3px;
    max-width: 100%;
}

.hero-quote {
    margin: var(--spacing-md) 0 var(--spacing-lg);
    border: none;
    padding: 0;
}

.quote-text {
    font-family: var(--font-serif);
    font-size: clamp(14px, 1.6vw, 30px);
    font-style: italic;
    color: var(--text-muted);
    font-weight: 700;
    line-height: 1.65;
    letter-spacing: 0.2px;
    margin: 0 auto;
    max-width: 80%;
}

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

.btn {
    font-family: var(--font-sans);
    font-weight: 400;
    border-radius: 8px;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--btn-sage);
    color: #FFFFFF;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--btn-sage-hover);
    color: #FFFFFF;
    box-shadow: 0 6px 20px rgba(140, 143, 122, 0.3);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 12px 36px;
    font-size: 18px;
}

/* ====================================
   Navigation
   ==================================== */

.navbar {
    background-color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark) !important;
}

.nav-link {
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--text-dark) !important;
    margin-left: var(--spacing-md);
}

.nav-link:hover {
    color: var(--btn-sage) !important;
}

/* ====================================
   Footer — matches Figma test design
   ==================================== */

.footer {
    background-color: #6B5E53;
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.footer-inner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.footer-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.footer p,
.footer-inner p {
    font-family: 'Inter', Helvetica, sans-serif;
    font-weight: 400;
    color: #FFFFFF;
    font-size: 14px;
    letter-spacing: 0;
    line-height: 24px;
    white-space: nowrap;
    margin: 0;
}


/* Legacy selector kept for backward compat */
.footer-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 22%;
}

.footer-content p {
    font-family: 'Inter', Helvetica, sans-serif;
    font-weight: 400;
    color: #FFFFFF;
    font-size: 14px;
    letter-spacing: 0;
    line-height: 24px;
    white-space: nowrap;
    margin: 0;
}

.shield-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #FFFFFF;
}

/* ====================================
   Add-Photo Screen
   ==================================== */

/* Right column variant — inherits flex-column from hero-content-col */
.add-photo-col {
    background-color: var(--bg-cream);
    padding: 0;
}

.add-photo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 10rem;
    max-width: 100%;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.6s ease-in-out;
}

/* Upload drop zone */
.upload-zone {
    border: 1px dashed var(--btn-sage);
    border-radius: 4px;
    background-color: var(--bg-cream);
    padding: var(--spacing-lg) var(--spacing-md);
    cursor: pointer;
    transition: border-color 0.25s, background-color 0.25s;
}

.upload-zone:hover,
.upload-zone--active {
    border-color: var(--btn-sage);
    background-color: #F4F6F0;
}

.upload-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-icon {
    color: var(--btn-sage);
    opacity: 0.75;
}

.upload-title {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.upload-hint {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.upload-format {
    font-family: var(--font-sans);
    font-size: 12px;
    color: #999;
}

/* Left-align form labels in add-photo form */
.add-photo-content .form-label {
    text-align: left;
    display: block;
}

form#addPhotoForm button.btn.btn-primary.btn-lg.px-5 {
    float: right;
}

.add-photo-content .form-control {
    text-align: left;
}

/* ====================================
   Capture-Voice Screen
   ==================================== */

.voice-col {
    background-color: var(--bg-cream);
    padding: 0;
}

.voice-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 10rem;
    max-width: 100%;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.6s ease-in-out;
}

/* Dashed recording card */
.voice-card {
    width: 75%;
    background-color: var(--bg-cream);
    border: 2px dashed var(--btn-sage);
    border-radius: 4px;
    padding: 28px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Smaller logo variant (capture-voice, etc.) */
.logo-img--sm {
    width: 100px;
    height: 100px;
}

.voice-prompt {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.54px;
}

/* Outlined action buttons (Record / Upload) */
.btn-voice-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 34px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    color: var(--btn-sage);
    background-color: transparent;
    border: 1px solid var(--btn-sage);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-voice-outline:hover {
    border-color: var(--btn-sage-hover);
    color: var(--btn-sage-hover);
    background-color: rgba(140, 143, 122, 0.08);
}

.btn-voice-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Skip link */
.voice-skip {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-muted);
    text-decoration: none;
}

.voice-skip:hover {
    color: var(--text-dark);
    text-decoration: underline;
}

/* Recording status bar */
.recording-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: #C0392B;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    padding: 8px 16px;
}

.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #C0392B;
    animation: blink 1s infinite;
    flex-shrink: 0;
}

.recording-label {
    font-weight: 600;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.2;
    }
}

/* ====================================
   Memory Preview / Reveal Screen
   ==================================== */

.preview-col {
    background-color: var(--bg-cream);
    padding: 0;
}

.preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 6rem;
    max-width: 100%;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.6s ease-in-out;
}

/* ══════════════════════════════════════════
   Realistic Open Book
   ══════════════════════════════════════════ */

/* Outer book frame — the physical cover/binding */
.open-book {
    position: relative;
    border-radius: 6px 8px 8px 6px;
    background: linear-gradient(160deg, #8A8768 0%, #7A7659 40%, #6E6A4F 100%);
    padding: 10px 12px 14px 16px;
    box-shadow:
        -5px 2px 14px rgba(0, 0, 0, 0.28),
        3px 5px 18px rgba(0, 0, 0, 0.20),
        0 10px 36px rgba(0, 0, 0, 0.14);
}

/* Binding curve at the top centre */
.book-binding {
    position: absolute;
    top: -2px;
    left: 35%;
    right: 35%;
    height: 14px;
    background: linear-gradient(to bottom, #5A5740 0%, #4E4C37 60%, #6E6A4F 100%);
    border-radius: 0 0 60% 60%;
    z-index: 3;
}

/* Inner pages container */
.book-pages {
    display: flex;
    background: #F4F2EC;
    border-radius: 3px 5px 5px 3px;
    min-height: 210px;
    overflow: hidden;
    position: relative;
}

/* Individual page */
.book-page {
    flex: 1;
    padding: 16px 14px 14px;
}

.book-left {
    background: #FAFAF6;
    text-align: left;
}

.book-right {
    background: #F5F3EC;
}

/* Spine gutter between pages */
.book-gutter {
    width: 10px;
    flex-shrink: 0;
    background: linear-gradient(to right,
            rgba(0, 0, 0, 0.09) 0%,
            rgba(0, 0, 0, 0.03) 45%,
            rgba(0, 0, 0, 0.03) 55%,
            rgba(0, 0, 0, 0.09) 100%);
    position: relative;
}

.book-gutter::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 8%;
    bottom: 8%;
    width: 1px;
    background: rgba(0, 0, 0, 0.10);
    transform: translateX(-50%);
}

/* ── Left page typography ─── */
.bk-story-name {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 700;
    color: #1E1E1E;
    margin-bottom: 6px;
    line-height: 1.25;
}

.bk-entry-title {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: #2C2C2C;
    margin-bottom: 4px;
}

.bk-meta {
    font-family: var(--font-sans);
    font-size: 11px;
    color: #777;
    margin-bottom: 3px;
    line-height: 1.4;
}

.bk-desc {
    font-family: var(--font-sans);
    font-size: 11px;
    color: #555;
    line-height: 1.55;
    margin-top: 8px;
    margin-bottom: 10px;
}

/* Media badges */
.bk-badges {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bk-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-sans);
    font-size: 10.5px;
    color: #5E6248;
    background: #EEEEE6;
    border: 1px solid #D8D9CC;
    border-radius: 20px;
    padding: 3px 10px;
    width: fit-content;
}

/* ── Right page photo collage ─── */
.bk-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 5px;
    height: 100%;
    min-height: 178px;
}

.bk-photo {
    border-radius: 4px;
    overflow: hidden;
    background: #DDD9CE;
}

.bk-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Main photo spans both rows (3-photo layout) */
.bk-photo-main {
    grid-row: 1 / 3;
}

.bk-photo-sm {
    /* natural second column slots */
}

/* ── Collage layout variants driven by data-count ─── */

/* 1 photo: single full-width cell */
.bk-collage[data-count="1"] {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

/* 2 photos: two equal columns, one row */
.bk-collage[data-count="2"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.bk-collage[data-count="2"] .bk-photo-main {
    grid-row: 1;
}

/* 3 photos: left main spans 2 rows, right column has 2 stacked */
.bk-collage[data-count="3"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

/* 4+ photos: 2×2 grid, no main cell */
.bk-collage[data-count="4"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.bk-collage[data-count="4"] .bk-photo-main {
    grid-row: 1;
}

/* Overlay for "+N more" on last cell */
.bk-photo {
    position: relative;
}

.bk-photo-more {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .85rem;
    font-weight: 600;
    border-radius: 4px;
}

/* ── Drop zone hint area (onboarding add-photo) ─── */
.um-drop-zone {
    border: 2px dashed var(--btn-sage) !important;
    border-radius: 4px;
    min-height: 160px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: transparent !important;
}

.um-drop-zone.upload-zone--active {
    border-color: var(--btn-sage);
    background: rgba(140, 143, 122, 0.06);
}

.um-drop-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    text-align: center;
}

.um-drop-hint .upload-icon {
    color: var(--btn-sage);
}

.um-drop-hint .upload-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #6B5E53;
}

.um-drop-hint .upload-hint {
    font-size: 1rem;
    color: #646B72;
}

.um-drop-hint .upload-format {
    font-size: 0.9rem;
    color: #646B72;
}

/* Right page placeholder (no photo uploaded) */
.bk-placeholder {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
}

.bk-ph-line {
    height: 8px;
    background: #E0DDD5;
    border-radius: 4px;
}

.bk-ph-wide {
    width: 90%;
}

.bk-ph-med {
    width: 70%;
}

.bk-ph-short {
    width: 50%;
}

.bk-ph-box {
    flex: 1;
    background: #E8E5DC;
    border-radius: 6px;
    min-height: 80px;
}

/* ── Confirmation & Progress ──────────── */

/* ====================================
   Reveal / Memory Preview — book + stacked thumbnails
   Matches test 4-Reveal.html design
   ==================================== */

.reveal-wrap {
    position: relative;
    width: 100%;
}

.reveal-book-img {
    margin: 0;
    width: 100%;
    line-height: 0;
}

.reveal-book-img img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Three stacked photo thumbnails on the right side, cascading down */
.reveal-photo-stack {
    position: absolute;
    right: 16%;
    top: 5%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.reveal-photo {
    width: 190px;
    height: 140px;
    object-fit: cover;
    border: 2.5px solid #ffffff;
    box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.18);
    border-radius: 2px;
    display: block;
}

/* Second photo shifts right — matches test rectangle-2 offset (+67px X) */
.reveal-photo--2 {
    margin-left: 18px;
    margin-top: 6px;
}

/* Third photo back to original X — matches test rectangle-3 */
.reveal-photo--3 {
    margin-top: 6px;
}

.preview-confirm {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.45px;
    line-height: 28px;
}

.yearbook-progress-wrap {
    text-align: left;
    width: 65%;
}

.yearbook-progress-label {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
}

.yearbook-progress-count {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--text-muted);
}

.yearbook-progress-bar {
    height: 12px;
    background-color: #E4E6DC;
    border-radius: 99px;
    overflow: hidden;
}

.yearbook-bar-fill {
    background-color: var(--btn-sage);
    border-radius: 99px;
    transition: width 1s ease;
}

/* ====================================
   Account Setup Screen
   ==================================== */

.setup-col {
    background-color: var(--bg-cream);
    padding: var(--spacing-xl) var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.setup-content {
    max-width: 460px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.6s ease-in-out;
}

/* "You just captured a Memory from child, age x" */
.setup-captured {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Dashed-border form card */
.setup-form-card {
    border: 1px dashed var(--btn-sage);
    border-radius: 4px;
    padding: 24px 22px 20px;
    background: var(--bg-cream);
}

.setup-form-intro {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Reminders toggle row */
.setup-reminder-row {
    text-align: left;
}

.setup-toggle {
    width: 42px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.setup-toggle:checked {
    background-color: var(--btn-sage);
    border-color: var(--btn-sage);
}

.setup-toggle-title {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.setup-toggle-desc {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
}

/* "Or Sign up with" */
.setup-or {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    position: relative;
}

/* Social icon buttons */
.btn-social {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid #D8DAD0;
    background: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    color: #333;
}

.btn-social:hover {
    border-color: var(--btn-sage);
    background-color: #F4F6F0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ====================================
   Forms
   ==================================== */

.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 16px;
    color: #9A9AB0 !important;
    transition: var(--transition);
    background-color: transparent !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--btn-sage);
    box-shadow: 0 0 0 0.2rem rgba(140, 143, 122, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-family: var(--font-sans);
}

/* ====================================
   Flash / Alert Messages
   ==================================== */

.alert {
    border-radius: 8px;
    border: none;
    font-family: var(--font-sans);
}

.alert-success {
    background-color: #D4EDDA;
    color: #155724;
}

.alert-danger {
    background-color: #F8D7DA;
    color: #721C24;
}

.alert-warning {
    background-color: #FFF3CD;
    color: #856404;
}

.alert-info {
    background-color: #D1ECF1;
    color: #0C5460;
}

/* ====================================
   Auth Pages (login / register)
   ==================================== */

.auth-page {
    background-color: var(--bg-cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-page .container {
    flex: 1;
}

.auth-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: var(--spacing-2xl) var(--spacing-xl);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
}

/* ====================================
   Dashboard Cards
   ==================================== */

.card {
    border-radius: 12px !important;
    border: 1px solid var(--border-color) !important;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

/* ====================================
   Responsive — Tablet (≤991px)
   ==================================== */

@media (max-width: 991.98px) {

    /* Both hero panels stack vertically */
    .hero-image-col {
        min-height: 42vh;
        order: 0;
    }

    .hero-image,
    .hero-image-wrapper,
    .hero-image-placeholder {
        min-height: 42vh;
    }

    .hero-content-col,
    .add-photo-col,
    .voice-col,
    .preview-col,
    .setup-col {
        padding: var(--spacing-xl) var(--spacing-lg);
        min-height: auto;
        order: 1;
    }

    .hero-title {
        font-size: 32px;
    }

    .quote-text {
        font-size: 18px;
    }

    /* Navbar compact */
    .navbar .container-fluid {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    /* Auth card full-width */
    .auth-card {
        max-width: 100% !important;
        padding: var(--spacing-xl) var(--spacing-lg);
    }

    /* Dashboard grid */
    .dashboard-grid .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ====================================
   Responsive — Mobile (≤576px)
   ==================================== */

@media (max-width: 575.98px) {

    /* Panels */
    .hero-image-col {
        min-height: 240px;
    }

    .hero-image,
    .hero-image-wrapper,
    .hero-image-placeholder {
        min-height: 240px;
    }

    .hero-content-col,
    .add-photo-col,
    .voice-col,
    .preview-col,
    .setup-col {
        padding: var(--spacing-lg) var(--spacing-md);
        min-height: auto;
    }

    .hero-content,
    .add-photo-content,
    .voice-content,
    .preview-content,
    .setup-content {
        text-align: center;
        max-width: 100%;
    }

    /* Typography */
    .hero-title {
        font-size: 24px;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .quote-text {
        font-size: 15px;
    }

    /* Logo */
    .logo-img {
        width: 90px;
        height: 90px;
    }

    .logo-container {
        margin-bottom: var(--spacing-md);
    }

    /* Buttons */
    .btn-lg {
        padding: 10px 20px;
        font-size: 15px;
    }

    .hero-content .btn-lg {
        width: 100%;
    }

    /* Upload zone */
    .upload-zone {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .upload-icon {
        width: 36px;
        height: 36px;
    }

    /* Auth card */
    .auth-card {
        padding: var(--spacing-lg) var(--spacing-md);
        border-radius: 12px;
    }

    /* Footer */
    .footer-content {
        font-size: 13px;
        flex-direction: column;
        text-align: center;
        gap: 0.4rem;
    }

    /* Dashboard: single column */
    .dashboard-grid .col-md-6,
    .dashboard-grid .col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Form elements */
    .form-control,
    .form-select {
        font-size: 15px;
    }

    /* Book stacks on mobile */
    .book-pages {
        flex-direction: column;
    }

    .book-gutter {
        width: 100%;
        height: 8px;
    }

    .book-gutter::after {
        display: none;
    }

    .bk-collage {
        min-height: 120px;
        grid-template-rows: 60px 60px;
    }

    .book-binding {
        left: 30%;
        right: 30%;
    }
}

/* ====================================
   Responsive — Small Mobile (≤375px)
   ==================================== */

@media (max-width: 375px) {
    .hero-title {
        font-size: 22px;
    }

    .logo-img {
        width: 78px;
        height: 78px;
    }
}

/* ====================================
   Animations
   ==================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeIn 0.6s ease-in-out;
}

/* ====================================
   Utilities
   ==================================== */

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

.fw-semibold {
    font-weight: 600;
}

.min-vh-100 {
    min-height: 100vh;
}

/* ====================================
   Print
   ==================================== */

@media print {

    .navbar,
    .footer {
        display: none;
    }
}

/* ====================================
   Memory Saved Screen
   ==================================== */

.saved-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-xl);
    max-width: 100%;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.6s ease-in-out;
}

.saved-title {
    font-family: var(--font-serif);
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0;
    line-height: 1.15;
}

.saved-ornament {
    font-size: 14px;
    color: var(--btn-sage);
    margin: 6px 0 10px;
    letter-spacing: 4px;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.divider-bottom {
    border: 1px solid #8C8F7A;
    width: 53%;
    margin: 30px 0px 40px 0px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 2px;
    background: #8C8F7A;
    border: 2px solid 8C8F7A;
    width: 200px;
}

.icon {
    width: 30px;
    height: 30px;
    background: #8a8f7a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 10px;
    font-size: 14px;
}

.saved-child-name {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.saved-date {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.saved-tagline {
    font-family: "Poppins";
    font-size: 18px;

    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Memory card — horizontal thumbnail + details */
.saved-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #FAFAF7;
    border: 1.5px solid #E2E4DA;
    border-radius: 12px;
    padding: 12px 16px;
    text-align: left;
    margin-bottom: 20px;
    width: 50%;
}

.saved-card-thumb {
    width: 91px;
    height: 91px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.saved-card-thumb-placeholder {
    width: 56px;
    height: 56px;
    background: #E8E5DC;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-card-name {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    color: #8C8F7A;
    margin-bottom: 3px;
}

.saved-card-badge {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--btn-sage);
    background: rgba(140, 143, 122, 0.1);
    border-radius: 20px;
    padding: 2px 10px;
    margin-bottom: 4px;
}

.saved-card-desc {
    font-family: var(--font-sans);
    font-size: 10px;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.saved-add-label {
    font-family: var(--font-sans);
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Two side-by-side outline buttons */
.saved-btn-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    width: 50%;
}

.btn-outline-sage {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 500;
    color: var(--btn-sage);
    background: transparent;
    border: 1px solid var(--btn-sage);
    border-radius: 6px;
    padding: 10px 14px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
    display: block;
    letter-spacing: 0.08px;
}

.btn-outline-sage:hover {
    border-color: var(--btn-sage-hover);
    color: var(--btn-sage-hover);
    background: rgba(140, 143, 122, 0.08);
}

.saved-content a.btn.btn-primary.btn-lg.w-100 {
    width: 50% !important;
    background: #6B5E53;
}

/* ====================================
   Dashboard Layout
   ==================================== */

.db-body {
    background: var(--bg-cream);
}

.db-wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Sidebar ── */
.db-sidebar {
    width: 13%;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: #F8F3EB;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 200;
}

.db-sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 10px 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 6px;
}

.db-brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
}

.db-brand-text {
    font-family: var(--font-serif);
    font-size: 24.5px;
    font-weight: 700;
    color: #838571;
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.3px;
}

.db-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 8px;
    gap: 2px;
    flex: 1;
}

.db-nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 6px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s ease;
    cursor: pointer;
}

.db-nav-item:hover {
    background: rgba(140, 143, 122, 0.1);
    color: var(--btn-sage);
}

.db-nav-item.active {
    background: rgba(140, 143, 122, 0.15);
    color: var(--btn-sage);
}

.db-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.db-nav-label {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    line-height: 1.3;
}

/* ── Main area ── */
.db-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 87%;
    margin-left: 13%;
    background-color: #F8F3EB;
}

/* ── Top nav ── */
.db-topnav {
    background: #F8F3EB;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.db-search-wrap {
    position: relative;
    flex: 1;
    max-width: 280px;
}

.db-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.db-search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid #E4E6DC;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    background: #FAFAF7;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s;
}

.db-search-input:focus {
    border-color: var(--btn-sage);
    background: #fff;
}

.db-topnav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.db-icon-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    cursor: pointer;
    transition: background 0.2s;
}

.db-icon-btn:hover {
    background: #F4F6F0;
    color: var(--btn-sage);
}

.db-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    border: 1.5px solid #E4E6DC;
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.db-user-pill:hover {
    border-color: var(--btn-sage);
}

.db-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--btn-sage);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-user-name {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
}

/* ── Content area ── */
.db-content {
    padding: 24px;
    flex: 1;
}

/* ====================================
   Dashboard — Welcome row
   ==================================== */

.db-welcome-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.db-welcome-heading {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.db-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1.5px solid #D8DAD0;
    border-radius: 8px;
    background: #fff;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.2s;
}

.db-filter-btn:hover {
    border-color: var(--btn-sage);
}

/* ====================================
   Dashboard — Hero Banner
   ==================================== */

.db-hero-banner {
    background: #B7BFAF;
    border-radius: 14px;
    padding: 28px 32px 20px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.db-hero-quote {
    font-family: var(--font-lora);
    font-size: 36px;
    font-style: italic;
    font-weight: 500;
    color: #383838;
    line-height: 1.55;
    margin-bottom: 18px;
    position: relative;
    text-align: center;
}

.db-hero-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    background: #8A7C6A;
    gap: 10px;
    width: 40%;
    margin: 0 auto;
    border-radius: 7px;
}

.db-hero-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #8A7C6A;
    border-radius: 8px;
    padding: 7px 14px;
}

.db-hero-date {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.db-hero-sep {
    color: rgba(255, 255, 255, 0.5);
}

.db-hero-q {
    font-family: var(--font-sans);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.db-hero-arrows {
    display: flex;
    gap: 6px;
    padding: 7px 14px;
}

.db-arrow-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.db-arrow-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ====================================
   Dashboard — Cards base
   ==================================== */

.db-card {
    background: #FFFFFF;
    border-radius: 14px;
    box-shadow: var(--drop-shadow);
    padding: 20px;
    height: 100%;
}

/* ====================================
   Dashboard — Upload card
   ==================================== */

.db-upload-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 180px;
    gap: 8px;
}

.db-upload-icon {
    width: 60px;
    height: 60px;
    background: rgba(140, 143, 122, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.db-upload-title {
    font-family: var(--font-serif);
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.db-upload-sub {
    font-family: var(--font-sans);
    font-size: 18px;
    color: var(--text-muted);
    margin: 0 0 8px;
}

/* ====================================
   Dashboard — Yearbook card
   ==================================== */

.db-yearbook-card {
    min-height: 180px;
}

.db-yearbook-title {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 700;
    color: #6B5E53;
    margin-bottom: 14px;
}

.db-yearbook-body {
    display: flex;
    align-items: center;
    gap: 16px;
}

.db-donut-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.db-donut {
    width: 80px;
    height: 80px;
}

.db-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.db-donut-pct {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.db-donut-lbl {
    font-family: var(--font-sans);
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.2;
    text-align: center;
}

.db-yk-count {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.db-yk-sub {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.db-yk-entry {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ====================================
   Dashboard — Stat cards
   ==================================== */

.db-stat-card {
    padding: 16px 18px;
}

.db-stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 4px;
    padding: 0px 0 15px 0;
}

.db-stat-num {
    font-family: var(--font-serif);
    font-size: 18px;
    width: 60%;
    font-weight: 700;
    color: #6B5E53;
    margin: 0;
    line-height: 30px;
}

.db-stat-title {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.db-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-stat-icon--blue {
    background: #E8EEF5;
    color: #5B87C5;
}

.db-stat-icon--green {
    background: rgba(140, 143, 122, 0.1);
    color: var(--btn-sage);
}

.db-stat-icon--warm {
    background: #F5EDE8;
    color: #C5845B;
}

.db-stat-sub {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1px;
}

.db-stat-desc {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.db-stat-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #EAEBE4;
}

.db-stat-growth {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--btn-sage);
}

.db-stat-link {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.db-stat-link:hover {
    color: var(--btn-sage);
}

/* ====================================
   Dashboard — Section title
   ==================================== */

.db-section-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

/* ====================================
   Dashboard — Quick Action cards
   ==================================== */

.db-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 0 20px;
    overflow: hidden;
}

.db-action-illustration {
    width: 100%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-bottom: 16px;
    border-radius: 14px 14px 0 0;
    min-height: 160px;
    overflow: hidden;
    border-bottom: 1px solid #E6EAED !important;
}

.db-action-img {
    width: 80%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 14px 14px 0 0;
}

.db-action-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: #6B5E53;
    margin-bottom: 12px;
    line-height: 1.4;
    padding: 0 12px;
}

/* ====================================
   Dashboard — Recently Added cards
   ==================================== */

.db-memory-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #EAEBE4;
    overflow: hidden;
}

.db-memory-thumb {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: #E8EBE2;
    overflow: hidden;
}

.db-memory-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.db-memory-thumb-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E8EBE2;
}

.db-memory-more {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5px;
    cursor: pointer;
    padding: 0;
}

.db-memory-more span {
    display: block;
    width: 3px;
    height: 3px;
    background: #666;
    border-radius: 50%;
}

.db-memory-info {
    padding: 10px 12px 12px;
}

.db-memory-title {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 600;
    color: #6B5E53;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-memory-meta {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 1px;
}

.db-memory-date {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.db-memory-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--btn-sage);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-empty-state {
    background: #fff;
    border-radius: 12px;
    border: 1.5px dashed #D0D4C8;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

/* ====================================
   Dashboard — Responsive
   ==================================== */

@media (max-width: 991px) {
    .db-sidebar {
        width: 70px;
    }

    .db-brand-text,
    .db-nav-label {
        display: none;
    }

    .db-brand-logo {
        width: 36px;
        height: 36px;
    }

    .db-main {
        margin-left: 70px;
    }

    .db-body .footer {
        margin-left: 70px;
    }
}

@media (max-width: 576px) {
    .db-sidebar {
        display: none;
    }

    .db-main {
        margin-left: 0;
    }

    .db-content {
        padding: 16px;
    }

    .db-body .footer {
        margin-left: 0;
    }
}

/* ====================================
   Upload Memory Modal
   ==================================== */

.um-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 32, 28, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.um-overlay[hidden] {
    display: none;
}

.um-dialog {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: umSlideIn 0.22s ease;
    overflow: hidden;
}

@keyframes umSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.um-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.um-title {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.um-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F4F6F0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    transition: background 0.15s;
    flex-shrink: 0;
}

.um-close:hover {
    background: #E8EBE2;
    color: var(--text-dark);
}

/* Body */
.um-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left column */
.um-left {
    width: 240px;
    flex-shrink: 0;
    padding: 20px 16px 20px 20px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.um-drop-zone {
    flex: 1;
    border: 1px dashed var(--btn-sage);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
    min-height: 240px;
    background: #FAFAF7;
}

.um-drop-zone:hover,
.um-drop-zone--over {
    border-color: var(--btn-sage);
    background: #F4F6F0;
}

.um-drop-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    gap: 6px;
}

.um-drop-icon {
    width: 56px;
    height: 56px;
    background: rgba(140, 143, 122, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.um-drop-main {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.5;
}

.um-drop-or {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.um-browse-link {
    background: none;
    border: none;
    color: var(--btn-sage);
    font-size: 12px;
    font-family: var(--font-sans);
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.um-drop-meta {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.um-drop-meta li {
    font-family: var(--font-sans);
    font-size: 10.5px;
    color: #999;
    line-height: 1.4;
}

/* ── Multi-photo grid (replaces single preview) ── */
.um-photo-grid {
    position: absolute;
    inset: 0;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    align-content: start;
    overflow-y: auto;
}

.um-photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 7px;
    overflow: hidden;
    background: #E8EBE2;
}

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

.um-vid-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--font-sans);
    font-size: 10px;
    color: #666;
    padding: 4px;
    text-align: center;
    word-break: break-all;
}

.um-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, .55);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background .15s;
}

.um-thumb-remove:hover {
    background: rgba(180, 0, 0, .75);
}

.um-photo-add {
    aspect-ratio: 1;
    border: 2px dashed var(--border-color);
    border-radius: 7px;
    background: #F7F9F5;
    color: #9BAD8C;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-family: var(--font-sans);
    font-size: 10px;
    transition: border-color .15s, background .15s;
}

.um-photo-add:hover {
    border-color: var(--btn-sage);
    background: rgba(140, 143, 122, 0.1);
}

/* Legacy single-preview (kept for any code that may still ref it) */
.um-drop-preview {
    display: none;
}

.um-remove-file {
    display: none;
}

/* Right column */
.um-right {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 20px 20px;
}

/* Form fields */
.um-field {
    margin-bottom: 14px;
}

.um-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
    letter-spacing: 0.1px;
}

.um-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #E0E3D8;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-dark);
    background: #FAFAF7;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    resize: none;
}

.um-input:focus {
    border-color: var(--btn-sage);
    background: #fff;
}

.um-input::placeholder {
    color: #b0b0a8;
}

.um-input--error {
    border-color: #c0392b !important;
    background: #fff8f7 !important;
}

.um-textarea {
    min-height: 70px;
    line-height: 1.5;
}

.um-field-hint {
    font-family: var(--font-sans);
    font-size: 10.5px;
    color: #999;
    margin: 4px 0 0;
}

.um-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: 6px;
    user-select: none;
}

.um-checkbox-label input {
    accent-color: var(--btn-sage);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Two-col row */
.um-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

/* Children tags */
.um-children-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.um-child-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    user-select: none;
}

.um-child-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #D4DBC8;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    transition: border-color 0.15s, background 0.15s;
}

.um-child-name {
    font-family: var(--font-sans);
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.um-child-tag--selected .um-child-avatar {
    background: var(--btn-sage);
    border-color: var(--btn-sage);
}

.um-child-tag--selected .um-child-name {
    color: var(--btn-sage);
    font-weight: 600;
}

.um-no-children {
    font-family: var(--font-sans);
    font-size: 11.5px;
    color: #aaa;
    font-style: italic;
}

/* Actions */
.um-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 6px;
}

.um-btn-cancel {
    padding: 8px 20px;
    border: 1.5px solid #D0D4C8;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.um-btn-cancel:hover {
    border-color: #999;
    color: var(--text-dark);
}

.um-btn-save {
    padding: 8px 22px;
    background: var(--btn-sage);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.um-btn-save:hover {
    background: var(--btn-sage-hover);
}

/* Responsive */
@media (max-width: 640px) {
    .um-body {
        flex-direction: column;
    }

    .um-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #EAEBE4;
        padding: 16px;
    }

    .um-drop-zone {
        min-height: 160px;
    }

    .um-right {
        padding: 16px;
    }

    .um-two-col {
        grid-template-columns: 1fr;
    }
}

/* ====================================
   Memory Library Page
   ==================================== */

.ml-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

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

.ml-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.ml-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ml-heading {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px;
}

.ml-subheading {
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0;
}

.ml-upload-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
}

.ml-filter-bar {
    background: #fff;
    border: 1px solid #EAEBE4;
    border-radius: 12px;
    padding: 14px 16px 12px;
    margin-bottom: 20px;
}

.ml-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #F0F1EA;
}

.ml-filter-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.ml-filter-btn {
    background: none;
    border: 1.5px solid transparent;
    border-radius: 8px;
    padding: 5px 12px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
}

.ml-filter-btn:hover {
    background: #F4F6F0;
    color: var(--text-dark);
}

.ml-filter-btn.active {
    background: rgba(140, 143, 122, 0.1);
    border-color: var(--border-color);
    color: var(--btn-sage);
    font-weight: 600;
}

.ml-filter-dropdowns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ml-dropdown-wrap {
    position: relative;
}

.ml-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #FAFAF7;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 10px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s;
}

.ml-dropdown-btn:hover {
    border-color: var(--btn-sage);
}

.ml-dropdown-btn.active {
    border-color: var(--btn-sage);
    color: var(--btn-sage);
    background: rgba(140, 143, 122, 0.1);
}

.ml-dropdown-wrap:hover .ml-dropdown-menu,
.ml-dropdown-wrap:focus-within .ml-dropdown-menu {
    display: block;
}

.ml-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    z-index: 300;
    padding: 6px 0;
    overflow: hidden;
}

.ml-dropdown-item {
    display: block;
    padding: 7px 14px;
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-dark);
    text-decoration: none;
    cursor: pointer;
    transition: background .12s;
}

.ml-dropdown-item:hover {
    background: #F4F6F0;
}

.ml-dropdown-item.selected {
    color: var(--btn-sage);
    font-weight: 600;
    background: rgba(140, 143, 122, 0.1);
}

.ml-dropdown-empty {
    display: block;
    padding: 7px 14px;
    font-family: var(--font-sans);
    font-size: 12px;
    color: #aaa;
    font-style: italic;
}

.ml-stats-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.ml-stats-count strong {
    color: var(--text-dark);
    font-weight: 600;
}

.ml-stats-sep {
    color: #C0C4B8;
}

.ml-clear-filters {
    margin-left: auto;
    font-size: 12px;
    color: var(--btn-sage);
    text-decoration: none;
    font-weight: 500;
}

.ml-clear-filters:hover {
    text-decoration: underline;
}

.ml-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.ml-card {
    background: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--drop-shadow);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .18s, transform .18s;
}

.ml-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .09);
    transform: translateY(-2px);
}

.ml-card-thumb {
    position: relative;
    width: 100%;
    padding-top: 78%;
    background: #E8EBE2;
    overflow: hidden;
}

.ml-card-thumb>img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ml-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E8EBE2;
}

.ml-card-placeholder--video {
    background: #DDE3D8;
}

.ml-card-placeholder--audio {
    background: #E3DDD8;
}

/* ── Memory library collage grid ── */
.ml-collage {
    position: absolute;
    inset: 0;
    display: grid;
    gap: 2px;
}

.ml-collage[data-count="1"] {
    grid-template-columns: 1fr;
}

.ml-collage[data-count="2"] {
    grid-template-columns: 1fr 1fr;
}

.ml-collage[data-count="3"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.ml-collage[data-count="3"] .ml-cc-cell:first-child {
    grid-row: 1/3;
}

.ml-collage[data-count="4"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.ml-cc-cell {
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.ml-cc-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ml-cc-more {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 700;
}

.ml-card-type-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 9.5px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 5px;
}

.ml-card-type-badge--video {
    background: rgba(40, 40, 140, .6);
}

.ml-card-type-badge--audio {
    background: rgba(100, 60, 20, .55);
}

.ml-card-menu {
    position: absolute;
    top: 8px;
    right: 8px;
}

.ml-card-menu-btn {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, .88);
    border: none;
    border-radius: 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5px;
    cursor: pointer;
    padding: 0;
}

.ml-card-menu-btn:hover {
    background: #fff;
}

.ml-card-menu-btn span {
    display: block;
    width: 3px;
    height: 3px;
    background: #555;
    border-radius: 50%;
}

.ml-card-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 130px;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    z-index: 400;
    padding: 5px 0;
}

.ml-card-dropdown[hidden] {
    display: none;
}

.ml-card-dropdown-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-dark);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    transition: background .12s;
    text-align: left;
}

.ml-card-dropdown-item:hover {
    background: #F4F6F0;
}

.ml-card-dropdown-item--delete {
    color: #b03030;
}

.ml-card-dropdown-item--delete:hover {
    background: #fff5f5;
}

.ml-card-info {
    padding: 10px 12px 12px;
}

.ml-card-title {
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ml-card-child {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-muted);
    margin: 0 0 1px;
}

.ml-card-date {
    font-family: var(--font-sans);
    font-size: 11px;
    color: #aaa;
    margin: 0 0 6px;
}

.ml-card-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-sans);
    font-size: 10px;
    color: var(--btn-sage);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ml-empty {
    background: #fff;
    border: 2px dashed #D8DBCF;
    border-radius: 14px;
    padding: 56px 24px;
    text-align: center;
}

.ml-empty-icon {
    width: 72px;
    height: 72px;
    background: rgba(140, 143, 122, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.ml-empty-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 6px;
}

.ml-empty-sub {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.ml-empty-link {
    background: none;
    border: none;
    color: var(--btn-sage);
    font-size: 13px;
    font-family: var(--font-sans);
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.ml-child-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s;
    margin-bottom: 2px;
}

.ml-child-link:hover {
    background: #F4F6F0;
}

.ml-child-link.active {
    background: rgba(140, 143, 122, 0.1);
}

.ml-child-link-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--btn-sage);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ml-child-link-name {
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-dark);
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ml-child-link-count {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-muted);
    background: #F0F1EA;
    border-radius: 999px;
    padding: 1px 7px;
}

@media (max-width:1200px) {
    .ml-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:900px) {
    .ml-layout {
        flex-direction: column;
    }

    .ml-sidebar {
        width: 100%;
    }

    .ml-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width:600px) {
    .ml-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ====================================
   Toast notification
   ==================================== */

.um-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    opacity: 0;
    background: #2d2d2d;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 10px;
    z-index: 2000;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
}

.um-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.um-toast--success {
    background: #3a6b2e;
}

.um-toast--error {
    background: #b03030;
}

/* ====================================
   Family Timeline Page
   ==================================== */

.tl-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

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

.tl-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.tl-heading-row {
    margin-bottom: 18px;
}

.tl-heading {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px;
}

.tl-subheading {
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0;
}

/* Filter bar (shared pattern with memory library) */
.tl-filter-bar {
    background: #fff;
    border: 1px solid #EAEBE4;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.tl-filter-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tl-filter-btn {
    background: none;
    border: 1.5px solid transparent;
    border-radius: 8px;
    padding: 5px 12px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
}

.tl-filter-btn:hover {
    background: #F4F6F0;
    color: var(--text-dark);
}

.tl-filter-btn.active {
    background: rgba(140, 143, 122, 0.1);
    border-color: var(--border-color);
    color: var(--btn-sage);
    font-weight: 600;
}

.tl-filter-dropdowns {
    display: flex;
    gap: 8px;
}

.tl-dropdown-wrap {
    position: relative;
}

.tl-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #FAFAF7;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 10px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
}

.tl-dropdown-btn:hover,
.tl-dropdown-btn.active {
    border-color: var(--btn-sage);
    color: var(--btn-sage);
}

.tl-dropdown-wrap:hover .tl-dropdown-menu,
.tl-dropdown-wrap:focus-within .tl-dropdown-menu {
    display: block;
}

.tl-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 150px;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    z-index: 300;
    padding: 6px 0;
}

.tl-dropdown-item {
    display: block;
    padding: 7px 14px;
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background .12s;
}

.tl-dropdown-item:hover {
    background: #F4F6F0;
}

.tl-dropdown-item.selected {
    color: var(--btn-sage);
    font-weight: 600;
    background: rgba(140, 143, 122, 0.1);
}

/* Year header */
.tl-year-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 6px;
}

.tl-year-badge {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 600;
    color: var(--btn-sage);
    background: rgba(140, 143, 122, 0.1);
    border-radius: 20px;
    padding: 2px 9px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.tl-year-label {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1;
}

/* Track */
.tl-track {
    position: relative;
    padding-left: 20px;
    margin-bottom: 32px;
}

.tl-track::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #E4E6DC;
    border-radius: 2px;
}

/* Month label */
.tl-month-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 10px;
}

.tl-month-label {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    background: #F4F6F0;
    border: 1px solid #E4E6DC;
    border-radius: 6px;
    padding: 2px 9px;
    flex-shrink: 0;
}

.tl-month-line {
    flex: 1;
    height: 1px;
    background: #E8EBE2;
}

/* Entry */
.tl-entry {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.tl-dot-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 16px;
}

.tl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--btn-sage);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--border-color);
    flex-shrink: 0;
    margin-top: 14px;
}

.tl-dot-line {
    flex: 1;
    width: 2px;
    background: #E4E6DC;
    margin-top: 4px;
}

.tl-card {
    flex: 1;
    background: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--drop-shadow);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .18s;
}

.tl-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .07);
}

.tl-card-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px 10px;
}

.tl-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--btn-sage);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tl-card-meta {
    flex: 1;
    min-width: 0;
}

.tl-card-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 3px;
}

.tl-card-info {
    font-family: var(--font-sans);
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0;
}

.tl-card-sep {
    margin: 0 4px;
    color: #C0C4B8;
}

/* Photo strip */
.tl-photo-strip {
    padding: 0 16px 10px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.tl-photo-thumb {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #E8EBE2;
}

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

.tl-photo-more {
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-photo-more span {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.tl-card-desc {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    padding: 0 16px 10px;
    line-height: 1.5;
}

.tl-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--btn-sage);
    font-weight: 500;
    padding: 8px 16px 12px;
    border-top: 1px solid #F0F1EA;
    margin-top: 4px;
}

/* Empty */
.tl-empty {
    background: #fff;
    border: 2px dashed #D8DBCF;
    border-radius: 14px;
    padding: 56px 24px;
    text-align: center;
}

.tl-empty-icon {
    width: 68px;
    height: 68px;
    background: rgba(140, 143, 122, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.tl-empty-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
}

.tl-empty-sub {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Sidebar widgets */
.tl-widget-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px;
}

.tl-progress-card {
    padding: 18px;
}

.tl-highlights-card {
    padding: 16px;
}

.tl-highlights-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tl-highlights-sub {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--text-muted);
    flex: 1;
}

.tl-view-all {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--btn-sage);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.tl-view-all:hover {
    text-decoration: underline;
}

.tl-highlights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.tl-highlight-thumb {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #E8EBE2;
}

.tl-highlight-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .2s;
}

.tl-highlight-thumb:hover img {
    transform: scale(1.04);
}

@media (max-width:900px) {
    .tl-layout {
        flex-direction: column;
    }

    .tl-sidebar {
        width: 100%;
    }
}

@media (max-width:576px) {
    .tl-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ====================================
   View Yearbook Page
   ==================================== */

.yb-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

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

.yb-sidebar {
    width: 220px;
    flex-shrink: 0;
}

.yb-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.yb-heading {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px;
}

.yb-subheading {
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0;
}

.yb-heading-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.yb-btn-outline {
    border: 1.5px solid #D0D4C8;
    background: transparent;
    color: var(--text-dark);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    padding: 7px 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}

.yb-btn-outline:hover:not(:disabled) {
    border-color: var(--btn-sage);
    color: var(--btn-sage);
}

.yb-btn-outline:disabled,
.yb-btn-print:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.yb-btn-print {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
}

/* Filter bar */
.yb-filter-bar {
    background: #fff;
    border: 1px solid #EAEBE4;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

.yb-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.yb-dropdown-wrap {
    position: relative;
}

.yb-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #FAFAF7;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 5px 11px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .15s;
}

.yb-dropdown-btn:hover,
.yb-dropdown-btn.active {
    border-color: var(--btn-sage);
    color: var(--btn-sage);
}

.yb-dropdown-wrap:hover .yb-dropdown-menu,
.yb-dropdown-wrap:focus-within .yb-dropdown-menu {
    display: block;
}

.yb-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    background: #fff;
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
    z-index: 300;
    padding: 6px 0;
}

.yb-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 14px;
    font-family: var(--font-sans);
    font-size: 12.5px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background .12s;
}

.yb-dropdown-item:hover {
    background: #F4F6F0;
}

.yb-dropdown-item.selected {
    color: var(--btn-sage);
    font-weight: 600;
    background: rgba(140, 143, 122, 0.1);
}

.yb-dropdown-count {
    font-size: 11px;
    color: #aaa;
}

.yb-dropdown-empty {
    display: block;
    padding: 7px 14px;
    font-size: 12px;
    color: #aaa;
    font-style: italic;
    font-family: var(--font-sans);
}

.yb-year-pill {
    background: rgba(140, 143, 122, 0.1);
    color: var(--btn-sage);
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    padding: 4px 12px;
}

/* ── Book ── */
.yb-book-scene {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    perspective: 2200px;
}

.yb-book {
    display: flex;
    width: 100%;
    max-width: 780px;
    min-height: 460px;
    border-radius: 3px 14px 14px 3px;
    box-shadow: -6px 6px 20px rgba(0, 0, 0, .18), 6px 6px 20px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .12);
    /* overflow:hidden removed — clips CSS 3D transforms */
    position: relative;
    transform-style: preserve-3d;
}

.yb-page {
    flex: 1;
    padding: 36px 32px;
    min-height: 460px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.yb-page-left {
    background: #FDFAF5;
    box-shadow: inset -6px 0 12px rgba(0, 0, 0, .06);
    border-radius: 3px 0 0 3px;
}

.yb-page-right {
    background: #fff;
    box-shadow: inset 6px 0 12px rgba(0, 0, 0, .04);
    border-radius: 0 14px 14px 0;
}

.yb-spine {
    width: 18px;
    flex-shrink: 0;
    background: linear-gradient(to right, #8B7355 0%, #C4A882 40%, #D4B896 50%, #C4A882 60%, #8B7355 100%);
    box-shadow: 0 0 8px rgba(0, 0, 0, .2);
    position: relative;
    z-index: 2;
}

/* ── Page-fold element ── */
.yb-fold {
    display: none;
    position: absolute;
    top: 0;
    height: 100%;
    width: calc(50% - 9px);
    /* half book minus half spine */
    transform-style: preserve-3d;
    pointer-events: none;
    z-index: 10;
}

.yb-fold.is-active {
    display: block;
}

.yb-fold.is-forward {
    right: 0;
    transform-origin: left center;
}

.yb-fold.is-backward {
    left: 0;
    transform-origin: right center;
}

.yb-fold-front,
.yb-fold-back {
    position: absolute;
    inset: 0;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

/* Forward: front = right page style, back = left page style */
.yb-fold.is-forward .yb-fold-front {
    background: #fff;
    box-shadow: inset 6px 0 12px rgba(0, 0, 0, .04), -10px 0 28px rgba(0, 0, 0, .18);
    border-radius: 0 14px 14px 0;
}

.yb-fold.is-forward .yb-fold-back {
    transform: rotateY(180deg);
    background: #FDFAF5;
    box-shadow: inset -6px 0 12px rgba(0, 0, 0, .06), 8px 0 24px rgba(0, 0, 0, .12);
    border-radius: 3px 0 0 3px;
}

/* Backward: front = left page style, back = right page style */
.yb-fold.is-backward .yb-fold-front {
    background: #FDFAF5;
    box-shadow: inset -6px 0 12px rgba(0, 0, 0, .06), 10px 0 28px rgba(0, 0, 0, .18);
    border-radius: 3px 0 0 3px;
}

.yb-fold.is-backward .yb-fold-back {
    transform: rotateY(-180deg);
    background: #fff;
    box-shadow: inset 6px 0 12px rgba(0, 0, 0, .04), -8px 0 24px rgba(0, 0, 0, .12);
    border-radius: 0 14px 14px 0;
}

/* Curl-shadow gradient on the turning face */
.yb-fold.is-forward .yb-fold-front::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, .12) 0%, transparent 35%);
    pointer-events: none;
    border-radius: inherit;
}

.yb-fold.is-backward .yb-fold-front::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, .12) 0%, transparent 35%);
    pointer-events: none;
    border-radius: inherit;
}

/* Page number watermark */
.yb-page-num {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 600;
    color: #C0C4B8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 auto;
}

/* Cover spread */
.yb-cover-left {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.yb-cover-badge {
    display: inline-block;
    background: rgba(140, 143, 122, 0.1);
    color: var(--btn-sage);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 20px;
    padding: 4px 12px;
    margin-bottom: 20px;
    align-self: flex-start;
}

.yb-cover-name {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px;
    line-height: 1.25;
}

.yb-cover-count {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 28px;
}

.yb-cover-ornament {
    font-size: 18px;
    color: var(--border-color);
    margin-bottom: 16px;
}

.yb-cover-tagline {
    font-family: var(--font-lora);
    font-style: italic;
    font-size: 14px;
    color: #8C9180;
    line-height: 1.55;
    margin: 0;
}

.yb-cover-right {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.yb-cover-intro {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0 0 16px;
}

.yb-cover-divider {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 20px 0;
}

.yb-cover-quote {
    font-family: var(--font-lora);
    font-style: italic;
    font-size: 13px;
    color: #8C9180;
    line-height: 1.6;
    margin: 0;
}

/* Memory spread */
.yb-mem-left {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.yb-mem-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 12px 0 6px;
    line-height: 1.25;
}

.yb-mem-child {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--btn-sage);
    margin: 0 0 2px;
}

.yb-mem-date {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 16px;
}

.yb-mem-desc {
    font-family: var(--font-lora);
    font-size: 13px;
    color: #555;
    line-height: 1.65;
    margin: 0 0 20px;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.yb-qr-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: auto;
}

.yb-qr-placeholder {
    width: 72px;
    height: 72px;
    background: #F4F6F0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed #D0D4C8;
}

.yb-qr-label {
    font-family: var(--font-sans);
    font-size: 10.5px;
    color: var(--text-muted);
    margin: 0;
}

.yb-media-icons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.yb-media-icon {
    font-family: var(--font-sans);
    font-size: 11px;
    color: var(--btn-sage);
    background: rgba(140, 143, 122, 0.1);
    border-radius: 6px;
    padding: 3px 8px;
    display: inline-block;
}

.yb-mem-right {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ── Collage grid (right page) ── */
.yb-collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.yb-collage-cell {
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    min-height: 0;
    background: #F7F5F0;
}

.yb-collage-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.yb-collage-cell:hover img {
    transform: scale(1.04);
}

/* Main cell spans full left column */
.yb-collage-cell--main {
    grid-column: 1;
    grid-row: 1 / 3;
}

/* Empty placeholder slot */
.yb-collage-cell--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1.5px dashed #D8DBCF;
    background: #FAFAF7;
}

.yb-collage-cell--empty span {
    font-family: var(--font-sans);
    font-size: 9px;
    color: #C8CCB8;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* Photo frame effect on cells */
.yb-collage-cell--main::after,
.yb-collage-cell:not(.yb-collage-cell--main):not(.yb-collage-cell--empty)::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
    border-radius: inherit;
    pointer-events: none;
}

/* End spread */
.yb-end-left,
.yb-end-right {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    text-align: center;
}

.yb-end-title {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 16px;
}

/* Navigation */
.yb-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px 0 4px;
}

.yb-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #D0D4C8;
    background: #fff;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.yb-nav-btn:hover:not(:disabled) {
    border-color: var(--btn-sage);
    background: rgba(140, 143, 122, 0.1);
    color: var(--btn-sage);
}

.yb-nav-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.yb-nav-label {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 60px;
    text-align: center;
}

/* Empty */
.yb-empty {
    background: #fff;
    border: 2px dashed #D8DBCF;
    border-radius: 14px;
    padding: 56px 24px;
    text-align: center;
}

.yb-empty-icon {
    width: 72px;
    height: 72px;
    background: rgba(140, 143, 122, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.yb-empty-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 6px;
}

.yb-empty-sub {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.yb-empty-link {
    color: var(--btn-sage);
    font-weight: 500;
}

/* Sidebar */
.yb-sidebar-hint {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 6px;
}

.yb-sidebar-sub {
    font-family: var(--font-sans);
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0 0 16px;
    line-height: 1.5;
}

.yb-sidebar-actions {
    display: flex;
    flex-direction: column;
}

/* ── Generate form card ── */
.yb-gen-card {
    padding: 20px;
}

.yb-gen-card-title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px;
}

.yb-gen-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yb-gen-label {
    font-family: var(--font-sans);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0;
}

.yb-gen-input {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-dark);
    background: #FAFAF8;
    border: 1.5px solid #E0E3D8;
    border-radius: 8px;
    padding: 8px 10px;
    width: 100%;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}

.yb-gen-input:focus {
    border-color: var(--btn-sage);
}

.yb-gen-input[type="date"] {
    cursor: pointer;
}

.yb-error-msg {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    border-radius: 6px;
    padding: 7px 10px;
    font-family: var(--font-sans);
    font-size: 11.5px;
    color: #DC2626;
    margin: 0;
    display: none;
}

/* ── Saved indicator ── */
.yb-saved-info {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 7px 10px;
    background: rgba(140, 143, 122, 0.1);
    border-radius: 7px;
    font-family: var(--font-sans);
    font-size: 11.5px;
    color: var(--btn-sage);
    font-weight: 500;
}

.yb-saved-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--btn-sage);
    flex-shrink: 0;
}

/* ── Empty book pages ── */
.yb-empty-pg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 10px;
    opacity: .55;
    text-align: center;
    padding: 16px;
}

.yb-empty-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 80%;
    align-items: center;
}

.yb-empty-line {
    height: 2.5px;
    background: #E4E6DC;
    border-radius: 2px;
}

.yb-empty-ornament {
    font-size: 14px;
    color: #D0D4C8;
    margin: 4px 0;
}

.yb-empty-pg-title {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 6px 0 2px;
}

.yb-empty-pg-sub {
    font-family: var(--font-sans);
    font-size: 11.5px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

@media (max-width:900px) {
    .yb-layout {
        flex-direction: column;
    }

    .yb-sidebar {
        width: 100%;
    }
}

@media (max-width:640px) {
    .yb-page {
        padding: 24px 18px;
    }

    .yb-heading-actions {
        display: none;
    }
}

@media (max-width:480px) {
    .yb-book {
        flex-direction: column;
        border-radius: 12px;
    }

    .yb-spine {
        width: 100%;
        height: 12px;
        background: linear-gradient(to bottom, #8B7355, #C4A882, #8B7355);
    }
}