:root {
    --bg: #f7f4ef;
    --paper: #fffdf9;
    --cream: #eee7dc;
    --rose: #bd9189;
    --rose-light: #e9d8d1;
    --brown: #51443e;
    --muted: #a3978d;
    --line: #e9e1d8;
    --green: #8d9b83;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--brown);
    font-family: 'DM Sans', sans-serif;
}

button, input, textarea, select {
    font: inherit;
}

button, a, label {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

.hidden {
    display: none !important;
}

/* LAYOUT */

.app-layout {
    max-width: 1600px;
    margin: auto;
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
}

/* SIDEBAR */

.sidebar {
    background: #f1ece5;
    min-height: 100vh;
    padding: 40px 25px 25px;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Playfair Display', serif;
    font-size: 25px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border: 1px solid var(--rose);
    color: var(--rose);
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.brand-dot {
    color: var(--rose);
}

.sidebar-label {
    margin: 65px 0 20px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 2px;
}

.navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 14px;
    background: transparent;
    border: 0;
    text-align: left;
    color: #82766e;
    font-size: 12px;
    border-radius: 4px;
    transition: .3s;
}

.nav-link > span:first-child {
    font-size: 18px;
    color: var(--rose);
    width: 22px;
}

.nav-link:hover,
.nav-link.active {
    background: #e7ddd4;
    color: var(--brown);
}

.nav-badge {
    margin-left: auto;
    font-size: 10px;
    color: var(--rose);
}

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-quote {
    padding: 22px 17px;
    background: #e9dfd5;
    margin-bottom: 25px;
}

.sidebar-quote > span {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    color: var(--rose);
}

.sidebar-quote p {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-style: italic;
    line-height: 1.6;
}

.sidebar-quote small {
    display: block;
    font-size: 8px;
    letter-spacing: 1.5px;
    margin-top: 15px;
    color: var(--muted);
}

.sidebar-footer {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
}

/* MAIN */

.main-content {
    min-width: 0;
    padding: 0 6%;
}

.topbar {
    min-height: 105px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.top-date {
    color: var(--rose);
    font-size: 9px;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.topbar h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 24px;
}

.topbar h2 span {
    color: var(--rose);
}

.top-right {
    color: var(--muted);
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px #8d9b831c;
}

/* HERO */

.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    padding: 75px 0 85px;
}

.section-kicker {
    color: var(--rose);
    font-size: 9px;
    letter-spacing: 2.5px;
    font-weight: 600;
}

.hero-copy h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(43px, 5vw, 65px);
    font-weight: 400;
    line-height: 1.18;
    margin-top: 25px;
}

.hero-copy h1 i {
    color: var(--rose);
    font-weight: 400;
}

.hero-copy > p {
    max-width: 350px;
    margin-top: 22px;
    font-size: 12px;
    line-height: 2;
    color: var(--muted);
}

.dark-button {
    border: 0;
    background: var(--brown);
    color: white;
    padding: 15px 22px;
    font-size: 11px;
    transition: .3s;
}

.dark-button:hover {
    background: var(--rose);
    transform: translateY(-3px);
}

.dark-button span {
    margin-left: 15px;
}

.hero-copy > .dark-button {
    margin-top: 30px;
}

.hero-signature {
    margin-top: 30px;
    font-family: 'Caveat', cursive;
    font-size: 19px;
    color: var(--muted);
}

.hero-signature span {
    color: var(--rose);
}

/* PHOTO */

.hero-visual {
    position: relative;
    padding: 12px 15px 18px 0;
}

.hero-photo {
    height: 380px;
    background: #ece4da;
    border: 10px solid var(--paper);
    box-shadow: 0 15px 45px #5542380b;
    position: relative;
    overflow: hidden;
    animation: gentleFloat 7s ease-in-out infinite;
}

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

.hero-photo.has-photo img {
    display: block;
}

.photo-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    background:
        radial-gradient(circle at 20% 20%, #f7eae1, transparent 45%),
        radial-gradient(circle at 80% 80%, #e4d7c9, transparent 45%),
        #eee6dc;
}

.hero-photo.has-photo .photo-placeholder {
    display: none;
}

.placeholder-icon {
    font-size: 40px;
    color: var(--rose);
    margin-bottom: 20px;
}

.photo-placeholder h3 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 400;
}

.photo-placeholder p {
    color: var(--muted);
    font-size: 11px;
    margin-top: 10px;
}

.photo-upload {
    display: inline-block;
    padding: 12px 19px;
    background: var(--brown);
    color: white;
    font-size: 10px;
    margin-top: 24px;
    cursor: pointer;
    transition: .3s;
}

.photo-upload:hover {
    background: var(--rose);
}

.photo-caption {
    position: absolute;
    bottom: 18px;
    left: 20px;
    color: white;
    opacity: 0;
    text-shadow: 0 2px 8px #000;
}

.hero-photo.has-photo .photo-caption {
    opacity: 1;
}

.photo-caption span {
    font-size: 8px;
    letter-spacing: 2px;
}

.photo-caption p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 22px;
    margin-top: 5px;
}

.photo-decoration {
    position: absolute;
    color: var(--rose);
    animation: gentleFloat 5s infinite;
}

.decoration-heart {
    top: -10px;
    right: 0;
    font-size: 33px;
}

.decoration-flower {
    bottom: -12px;
    left: -10px;
    font-size: 28px;
    animation-delay: 1.5s;
}

/* NOTE */

.little-note {
    background: #eee7dd;
    padding: 23px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 90px;
}

.note-symbol {
    color: var(--rose);
    font-size: 24px;
}

.little-note small {
    color: var(--rose);
    font-size: 8px;
    letter-spacing: 2px;
}

.little-note p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 17px;
    margin-top: 5px;
}

.note-heart {
    margin-left: auto;
    color: var(--rose);
    font-size: 24px;
}

/* COLLECTION */

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 30px;
}

.section-heading h2,
.book-preview h2,
.simple-section h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 32px;
    margin-top: 10px;
}

.heading-note {
    color: var(--muted);
    font-family: 'Caveat', cursive;
    font-size: 19px;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.collection-card {
    text-align: left;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 10px;
    transition: .4s;
    min-width: 0;
    cursor: pointer;
}

.collection-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 15px 35px #5542380d;
}

.collection-art {
    height: 205px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.book-art {
    background: #e8ded2;
}

.art-book {
    width: 100px;
    height: 135px;
    display: grid;
    place-items: center;
    text-align: center;
    background: #b58c7e;
    color: #fff8ee;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    line-height: 1.6;
    box-shadow: 7px 7px 0 #987567;
    transform: rotate(-5deg);
    transition: .5s;
}

.book-card:hover .art-book {
    transform: rotate(0deg) scale(1.06);
}

.art-flower {
    position: absolute;
    right: 25px;
    top: 20px;
    color: #b58c7e;
    font-size: 28px;
}

.gallery-art {
    background: #d9ddd3;
    color: #71806d;
    font-size: 75px;
}

.voice-art {
    background: #eadbd5;
    color: #b58c7e;
    font-size: 70px;
}

.collection-info {
    padding: 17px 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collection-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 400;
}

.collection-info p {
    font-size: 9px;
    color: var(--muted);
    margin-top: 7px;
}

.collection-info > span {
    color: var(--rose);
}

/* BOOK PREVIEW */

.book-preview {
    margin-top: 100px;
    padding: 55px;
    background: #eae1d7;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 30px;
    overflow: hidden;
}

.book-preview h2 {
    font-size: 39px;
    line-height: 1.25;
    margin-top: 20px;
}

.book-preview h2 i {
    color: var(--rose);
}

.book-preview-copy > p {
    max-width: 330px;
    color: var(--muted);
    font-size: 11px;
    line-height: 2;
    margin-top: 18px;
}

.outline-button {
    background: transparent;
    border: 1px solid var(--brown);
    color: var(--brown);
    padding: 13px 19px;
    font-size: 10px;
    margin-top: 25px;
    transition: .3s;
}

.outline-button:hover {
    background: var(--brown);
    color: white;
}

.book-illustration {
    display: grid;
    place-items: center;
    min-height: 230px;
    perspective: 900px;
}

.book-cover {
    width: 175px;
    height: 220px;
    background: #aa7d70;
    color: #fff5e9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 10px 10px 0 #8e685d;
    transform: rotate(5deg);
    transition: .6s;
    border-left: 7px solid #91675c;
}

.book-cover:hover {
    transform: rotate(0) scale(1.06);
}

.book-cover > span {
    font-size: 8px;
    letter-spacing: 2px;
}

.book-cover h3 {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    font-weight: 400;
    margin: 10px 0;
}

.book-cover i {
    font-family: 'Caveat', cursive;
    font-size: 17px;
}

.cover-flower {
    margin-top: 15px;
    font-size: 24px;
}

/* SIMPLE SECTIONS */

.simple-section {
    padding: 75px 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 30px;
}

.simple-section p {
    color: var(--muted);
    font-size: 11px;
    margin-top: 12px;
}

.main-footer {
    padding: 40px 0;
    text-align: center;
}

.main-footer > span {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
}

.main-footer p {
    color: var(--muted);
    font-size: 10px;
    margin-top: 8px;
}

/* BOOK MODAL */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    background: #30272188;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-overlay.open {
    display: flex;
    animation: fadeIn .25s ease;
}

.book-modal {
    width: min(760px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--paper);
    padding: 40px;
    position: relative;
    animation: modalAppear .35s ease;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    z-index: 100;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.34);
    color: var(--muted);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.book-modal-header {
    text-align: center;
    padding-bottom: 28px;
}

.book-modal-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 39px;
    font-weight: 400;
    margin-top: 15px;
}

.book-modal-header h2 i {
    color: var(--rose);
}

.book-modal-header p {
    font-size: 11px;
    color: var(--muted);
    margin-top: 10px;
}

.book-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.tab-button,
.download-button {
    padding: 10px 13px;
    border: 0;
    background: transparent;
    font-size: 10px;
    color: var(--muted);
}

.tab-button.active {
    background: #eee6dd;
    color: var(--brown);
}

.download-button {
    margin-left: auto;
    color: var(--rose);
}

.book-view {
    padding-top: 25px;
}

.empty-book {
    padding: 40px 15px;
    text-align: center;
}

.empty-book > span {
    color: var(--rose);
    font-size: 35px;
}

.empty-book h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 25px;
    margin-top: 12px;
}

.empty-book p {
    color: var(--muted);
    font-size: 11px;
    margin: 10px 0 22px;
}

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

.entry-card {
    padding: 22px;
    background: #f5f0e9;
    border-left: 3px solid var(--rose);
    cursor: pointer;
    transition: .3s;
}

.entry-card:hover {
    transform: translateX(-4px);
    background: #eee5da;
}

.entry-card small {
    color: var(--rose);
    font-size: 9px;
    letter-spacing: 1px;
}

.entry-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 21px;
    font-weight: 400;
    margin: 9px 0;
}

.entry-card p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.8;
}

.entry-author {
    display: block;
    color: var(--rose);
    font-size: 10px;
    margin-top: 13px;
}

/* EDITOR */

#memoryForm {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

#memoryForm label {
    font-size: 11px;
    color: var(--brown);
    margin-top: 8px;
}

#memoryForm input,
#memoryForm textarea,
#memoryForm select {
    width: 100%;
    border: 1px solid var(--line);
    background: #faf7f2;
    padding: 13px;
    color: var(--brown);
    outline: none;
    font-size: 12px;
    border-radius: 0;
}

#memoryForm input:focus,
#memoryForm textarea:focus,
#memoryForm select:focus {
    border-color: var(--rose);
}

#memoryForm textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.9;
    font-family: 'Caveat', cursive;
    font-size: 18px;
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 15px;
}

.cancel-button {
    background: transparent;
    border: 1px solid var(--line);
    padding: 12px 18px;
    color: var(--muted);
    font-size: 11px;
}

/* OPENED PAGE */

.back-button {
    background: transparent;
    border: 0;
    color: var(--rose);
    font-size: 11px;
    margin-bottom: 20px;
}

.opened-page {
    background: #faf6ee;
    padding: 35px;
    border: 1px solid var(--line);
}

.opened-page h2 {
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    font-weight: 400;
    margin: 15px 0;
}

.opened-author {
    color: var(--rose);
    font-size: 10px;
}

.opened-content {
    white-space: pre-wrap;
    font-family: 'Caveat', cursive;
    font-size: 21px;
    line-height: 1.9;
    margin-top: 30px;
    overflow-wrap: anywhere;
}

.opened-footer {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--rose);
    margin-top: 45px;
}

.delete-button {
    display: block;
    margin: 25px auto 0;
    background: transparent;
    border: 1px solid #d6b5ae;
    color: #a76e66;
    padding: 10px 15px;
    font-size: 10px;
}

/* ANIMATIONS */

@keyframes gentleFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.98);
    }

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* RESPONSIVE */

@media (max-width: 950px) {
    .app-layout {
        grid-template-columns: 190px minmax(0, 1fr);
    }

    .main-content {
        padding: 0 4%;
    }

    .hero-section {
        gap: 25px;
    }

    .collection-grid {
        gap: 12px;
    }

    .collection-art {
        height: 160px;
    }
}

@media (max-width: 700px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        min-height: auto;
        padding: 18px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-label,
    .sidebar-bottom {
        display: none;
    }

    .navigation {
        flex-direction: row;
        overflow-x: auto;
        margin-top: 18px;
        padding-bottom: 5px;
    }

    .nav-link {
        width: auto;
        min-width: max-content;
        font-size: 10px;
        padding: 10px;
    }

    .main-content {
        padding: 0 6%;
    }

    .topbar {
        min-height: 85px;
    }

    .top-right {
        display: none;
    }

    .hero-section {
        grid-template-columns: 1fr;
        padding: 55px 0;
        gap: 40px;
    }

    .hero-copy h1 {
        font-size: 46px;
    }

    .hero-photo {
        height: 330px;
    }

    .little-note {
        padding: 18px;
        gap: 12px;
        margin-bottom: 65px;
    }

    .little-note p {
        font-size: 14px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .collection-grid {
        grid-template-columns: 1fr;
    }

    .collection-art {
        height: 220px;
    }

    .book-preview {
        padding: 30px 22px;
        grid-template-columns: 1fr;
    }

    .book-modal {
        padding: 28px 18px;
    }

    .book-toolbar {
        gap: 5px;
    }

    .download-button {
        margin-left: 0;
    }

    .opened-page {
        padding: 22px;
    }
}

/* THE HOME — WARM COUNTER & MEDIA GALLERY */
.hero-visual{position:relative}
.together-counter{position:absolute;left:-125px;bottom:34px;width:245px;padding:22px 20px;background:rgba(255,253,249,.96);border:1px solid #eadbd2;border-radius:18px;box-shadow:0 18px 45px #6b4c3b18;z-index:3;backdrop-filter:blur(10px);animation:counterFloat 5s ease-in-out infinite}
.counter-kicker{font-size:9px;letter-spacing:1.6px;color:#ad8279}
.counter-numbers{display:flex;align-items:baseline;gap:5px;margin:12px 0 8px;flex-wrap:wrap}
.counter-numbers strong{font: bold 27px 'Playfair Display',serif;color:#785c54}
.counter-numbers small{font-size:10px;color:#a3978d;margin-right:5px}
.together-counter p{font:italic 13px 'Playfair Display',serif;color:#8b7168;line-height:1.5}
.counter-edit{margin-top:12px;border:0;background:transparent;color:#a77e75;font-size:11px;text-decoration:underline}
@keyframes counterFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
.media-section{padding:65px 0}
.media-hint{color:var(--muted);font-size:13px;margin-top:-15px;margin-bottom:25px}
.media-add{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.media-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.media-item{position:relative;background:var(--paper);padding:9px;border-radius:15px;box-shadow:0 8px 25px #57443a0c;overflow:hidden}
.media-item img,.media-item video{width:100%;height:230px;object-fit:cover;display:block;border-radius:10px;background:#eee7dc}
.media-caption{padding:12px 5px 5px;font-size:12px;color:var(--brown)}
.media-caption small{display:block;color:var(--muted);margin-top:4px}
.media-remove{position:absolute;top:15px;right:15px;border:0;border-radius:50%;width:30px;height:30px;background:#fffdf0e8;color:#8b625b;font-size:17px}
.media-empty{grid-column:1/-1;text-align:center;padding:45px 20px;border:1px dashed #d9c8bd;border-radius:16px;color:#a28d82;background:#fffaf6}
.date-setup-overlay{position:fixed;inset:0;background:#493a35a8;z-index:2000;display:none;align-items:center;justify-content:center;padding:20px;backdrop-filter:blur(7px)}
.date-setup-overlay.open{display:flex}
.date-setup-card{width:min(100%,460px);background:#fffdf9;border-radius:24px;padding:38px;box-shadow:0 25px 80px #24171235;display:flex;flex-direction:column;gap:12px;animation:modalAppear .3s ease}
.setup-flower{font-size:34px;color:#bd9189}
.date-setup-card h2{font:32px 'Playfair Display',serif;color:var(--brown)}
.date-setup-card h2 i{color:#bd9189}
.date-setup-card p{color:var(--muted);font-size:13px;line-height:1.7;margin-bottom:8px}
.date-setup-card label{font-size:12px;color:#806d64;margin-top:5px}
.date-setup-card input{padding:13px;border:1px solid var(--line);border-radius:10px;background:#fffaf6;color:var(--brown);outline:none}
.date-setup-card input:focus{border-color:var(--rose)}
.date-setup-card button{margin-top:12px}
@media(max-width:1050px){.together-counter{left:-65px;width:220px}}
@media(max-width:760px){.together-counter{position:relative;left:auto;bottom:auto;width:100%;margin:15px 0 0;animation:none}.hero-visual{display:flex;flex-direction:column}.media-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.media-item img,.media-item video{height:180px}}
@media(max-width:480px){.media-grid{grid-template-columns:1fr}.media-item img,.media-item video{height:230px}.date-setup-card{padding:27px 22px}}


/* =========================================
   THE HOME — PREMIUM WELCOME & SETTINGS
========================================= */
.welcome-screen{position:fixed;inset:0;z-index:3000;min-height:100vh;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;padding:34px clamp(24px,6vw,92px);background:radial-gradient(ellipse at 18% 20%,#f4dfd6 0,transparent 34%),radial-gradient(ellipse at 84% 78%,#ead8ce 0,transparent 32%),linear-gradient(135deg,#fbf7f1 0%,#f5eae2 48%,#f9f3ec 100%);color:#57443d;transition:opacity .42s ease,transform .42s ease}
.welcome-screen[hidden]{display:none}.welcome-screen:before,.welcome-screen:after{content:"";position:absolute;pointer-events:none;border:1px solid #c9a79b55;border-radius:50%;width:min(58vw,700px);aspect-ratio:1;right:-13%;top:-28%;transform:rotate(-20deg)}.welcome-screen:after{width:min(42vw,520px);right:auto;left:-17%;top:auto;bottom:-28%;border-color:#b98f8450}
.welcome-glow{position:absolute;width:260px;height:260px;border-radius:50%;filter:blur(65px);opacity:.3;pointer-events:none}.glow-one{background:#d7aaa0;left:22%;top:30%}.glow-two{background:#e8c9b8;right:20%;bottom:15%}
.welcome-top,.welcome-bottom{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between}.welcome-mark{font:42px 'Playfair Display',serif;color:#a77c72}.language-switch{border:1px solid #d9c4b9;background:#fffaf5b8;color:#795e55;padding:10px 17px;border-radius:30px;cursor:pointer;font-size:12px;transition:.25s}.language-switch:hover{background:#fff;transform:translateY(-2px)}
.welcome-content{position:relative;z-index:1;width:min(690px,100%);margin:auto; padding:70px 0 80px;text-align:center;animation:welcomeRise .9s both}.welcome-eyebrow{font-size:10px;letter-spacing:3.5px;color:#ae8278;font-weight:700}.welcome-content h1{font:clamp(76px,12vw,150px)/.98 'Playfair Display',serif;letter-spacing:-5px;color:#58453e;margin:26px 0 24px}.welcome-content h1 i{font-weight:400;color:#b8877e}.welcome-content p{max-width:490px;margin:0 auto;color:#8f7b71;font:17px/1.9 'DM Sans',sans-serif}.welcome-enter{margin-top:42px;min-width:245px;padding:18px 23px;border:0;border-radius:3px;background:#59463f;color:#fffaf5;display:inline-flex;align-items:center;justify-content:space-between;gap:32px;font-size:13px;letter-spacing:.4px;cursor:pointer;box-shadow:0 15px 35px #5b433c25;transition:transform .3s,box-shadow .3s}.welcome-enter b{font-size:20px;font-weight:400}.welcome-enter:hover{transform:translateY(-4px);box-shadow:0 20px 42px #5b433c35}.welcome-footnote{display:block;margin-top:28px;font-size:9px;letter-spacing:2.8px;color:#b59b90}.welcome-bottom{font:12px 'Caveat',cursive;color:#a58a80}.welcome-bottom span{font-size:18px;color:#bc9187}.welcome-leaving{opacity:0;transform:scale(1.025);pointer-events:none}@keyframes welcomeRise{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
.app-layout{opacity:1;transition:opacity .35s ease}.app-layout:not(.app-ready){filter:blur(2px)}.app-layout.app-ready{filter:none;animation:welcomeRise .55s both}.settings-trigger{margin-left:16px;border:1px solid var(--line);border-radius:30px;padding:9px 14px;background:#fffaf6;color:var(--brown);font-size:11px;cursor:pointer;transition:.2s}.settings-trigger:hover{background:#f2e4dc;transform:translateY(-2px)}
.settings-overlay{position:fixed;inset:0;z-index:2100;background:#43332e9c;backdrop-filter:blur(8px);display:none;align-items:center;justify-content:center;padding:20px}.settings-overlay.open{display:flex}.settings-card{position:relative;width:min(100%,500px);background:#fffaf5;border:1px solid #eadbd2;border-radius:25px;padding:38px;box-shadow:0 28px 90px #24171238;animation:modalAppear .3s ease}.settings-close{position:absolute;top:16px;right:19px;border:0;background:none;color:#8e746b;font-size:28px;cursor:pointer}.settings-card h2{font:34px 'Playfair Display',serif;color:var(--brown);margin:12px 0}.settings-card h2 i{color:#b8877e}.settings-card>p{font-size:13px;line-height:1.8;color:var(--muted);margin-bottom:20px}.settings-photo-preview{height:190px;border:1px dashed #d8bfb4;border-radius:17px;background:linear-gradient(145deg,#f7ece5,#fdf8f3);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;overflow:hidden;color:#b58d82}.settings-photo-preview>span{font-size:35px}.settings-photo-preview small{font-size:11px}.settings-photo-preview img{width:100%;height:100%;object-fit:cover}.settings-upload{display:block;text-align:center;margin-top:15px;padding:14px;border:1px solid #d9c4b9;border-radius:12px;color:#795e55;font-size:12px;cursor:pointer;transition:.2s}.settings-upload:hover{background:#f5e9e1}.settings-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}.settings-actions .dark-button{padding:13px 18px}.settings-remove{border:0;background:transparent;color:#a47d74;text-decoration:underline;font-size:12px;cursor:pointer}.settings-language{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #eee1d9;margin-top:24px;padding-top:18px;color:#806d64;font-size:12px}
html[dir="rtl"] .welcome-content,html[dir="rtl"] .settings-card{text-align:right}html[dir="rtl"] .welcome-content p{margin-right:auto;margin-left:auto}html[dir="rtl"] .settings-close{right:auto;left:19px}
@media(max-width:700px){.welcome-screen{padding:24px}.welcome-content{padding:55px 0}.welcome-content h1{letter-spacing:-3px}.welcome-content p{font-size:14px}.welcome-bottom{font-size:11px;gap:10px}.settings-card{padding:30px 22px}.settings-trigger{margin-left:4px}.top-right{display:flex!important;flex-wrap:wrap;justify-content:flex-end}.media-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.welcome-content,.welcome-enter,.welcome-screen,.app-layout{animation:none!important;transition:none!important}}

/* THE HOME — premium date setup + full RTL polish */
.date-setup-overlay{background:radial-gradient(circle at 18% 15%,#d9b6aa55,transparent 34%),rgba(63,45,39,.66);backdrop-filter:blur(14px);padding:24px}
.date-setup-card{position:relative;overflow:hidden;width:min(100%,560px);padding:clamp(30px,5vw,54px);gap:15px;border:1px solid #eadbd2;border-radius:30px;background:linear-gradient(145deg,#fffdfa 0%,#fbf3ed 100%);box-shadow:0 35px 100px #24171245}
.date-setup-card:before{content:"";position:absolute;width:220px;height:220px;border:1px solid #d9b9ad66;border-radius:50%;top:-135px;right:-80px;pointer-events:none}
.date-setup-card:after{content:"⌂";position:absolute;bottom:18px;right:25px;color:#d9b9ad55;font:54px Georgia;pointer-events:none}
.date-setup-card .setup-flower{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#f3e5df;color:#b9877c;font-size:25px;margin-bottom:5px}
.date-setup-card .section-kicker{font-size:10px;letter-spacing:3px;color:#bd9185;font-weight:700}
.date-setup-card h2{font-size:clamp(30px,5vw,43px);line-height:1.18;max-width:440px;margin:0;color:#57463f}
.date-setup-card p{font-size:14px;line-height:1.9;max-width:420px;color:#927f75;margin:0 0 7px}
.date-setup-card label{font-size:12px;font-weight:700;color:#806b61;margin:8px 0 0}
.date-setup-card input{width:100%;min-height:54px;padding:14px 16px;border:1px solid #e8d9d0;border-radius:14px;background:#fffdfa;font:inherit;color:#57463f;transition:.2s}
.date-setup-card input:focus{border-color:#c99c90;box-shadow:0 0 0 4px #d9b9ad30}
.date-setup-card button{min-height:54px;border-radius:14px;margin-top:10px;font-weight:700;letter-spacing:.2px}
html[dir="rtl"] .date-setup-card{text-align:right}
html[dir="rtl"] .date-setup-card:before{right:auto;left:-80px}
html[dir="rtl"] .date-setup-card:after{right:auto;left:25px}
html[dir="rtl"] .date-setup-card .setup-flower{margin-left:auto;margin-right:0}
html[dir="rtl"] .date-setup-card input{text-align:right;direction:rtl}
html[dir="rtl"] .date-setup-card .section-kicker{letter-spacing:1px}
html[dir="rtl"] body{font-family:'DM Sans',Tahoma,Arial,sans-serif}
html[dir="rtl"] .sidebar,html[dir="rtl"] .main-content,html[dir="rtl"] .book-modal,html[dir="rtl"] .settings-card{direction:rtl}
html[dir="rtl"] .top-right{direction:rtl}
html[dir="rtl"] .counter-numbers{direction:rtl}
html[dir="rtl"] .photo-caption{right:auto;left:18px;text-align:left}
html[dir="rtl"] .settings-close{right:auto;left:18px}
@media(max-width:480px){.date-setup-card{border-radius:24px;padding:28px 22px}.date-setup-card h2{font-size:30px}}


/* SUPABASE ACCOUNT FLOW */
.account-screen{position:fixed;inset:0;z-index:3200;display:flex;align-items:center;justify-content:center;padding:24px;background:radial-gradient(ellipse at 15% 15%,#f1ddd5,transparent 38%),linear-gradient(135deg,#fbf7f1,#f3e7df);overflow:auto}.account-screen[hidden]{display:none}.account-card{width:min(100%,490px);padding:clamp(26px,5vw,44px);border:1px solid #eadbd2;border-radius:25px;background:#fffaf5;box-shadow:0 25px 80px #50372c1c;color:#59463f}.account-brand{font:27px 'Playfair Display',serif;color:#b8877e;margin-bottom:28px}.account-brand span{color:#59463f}.account-card h2{font:34px 'Playfair Display',serif;margin:12px 0;color:#59463f}.account-card h2 i{color:#b8877e}.account-intro{font-size:13px;line-height:1.8;color:#8f7b71;margin:0 0 22px}.auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:5px;border-radius:13px;background:#f4eae4;margin-bottom:20px}.auth-tabs button{border:0;background:transparent;padding:11px;border-radius:9px;color:#806d64;cursor:pointer}.auth-tabs button.active{background:#fffaf5;color:#59463f;box-shadow:0 2px 10px #60483c12}.account-card label{display:block;font-size:12px;color:#806d64;margin:14px 0 7px}.account-card input{width:100%;padding:14px 15px;border:1px solid #e4d4ca;border-radius:11px;background:#fffdfb;color:#59463f;outline:none;font:14px 'DM Sans',sans-serif}.account-card input:focus{border-color:#b8877e;box-shadow:0 0 0 3px #b8877e20}.account-submit{width:100%;margin-top:20px;padding:15px}.account-message{min-height:22px;margin:13px 0 0;color:#9b625b;font-size:12px;line-height:1.7}.account-divider{display:flex;align-items:center;gap:12px;margin:23px 0 8px;color:#b19a90;font-size:9px;letter-spacing:1.5px}.account-divider:before,.account-divider:after{content:'';height:1px;background:#eadbd2;flex:1}.outline-account{width:100%;margin-top:12px;padding:13px;border:1px solid #d9c4b9;border-radius:11px;background:transparent;color:#795e55;cursor:pointer}.account-back{display:block;margin:22px auto 0;border:0;background:none;color:#a18479;font-size:12px;cursor:pointer}.account-card [hidden]{display:none!important}html[dir="rtl"] .account-card{text-align:right}

.password-wrap{position:relative;display:flex;align-items:center}.password-wrap input{padding-right:76px}.password-toggle{position:absolute;right:9px;top:50%;transform:translateY(-50%);border:0;border-radius:8px;background:#f4eae4;color:#795e55;padding:7px 10px;font-size:11px;cursor:pointer}.password-hint{display:block;margin-top:7px;color:#a18c81;font-size:10px}.account-card #otpPanel{margin-top:16px}.account-card #otpPanel[hidden]{display:none!important}html[dir="rtl"] .password-wrap input{padding-right:15px;padding-left:76px}html[dir="rtl"] .password-toggle{right:auto;left:9px}

/* THE HOME control panel and readable Arabic typography */
:root{--app-font-size:100%;--arabic-font:'Cairo',Tahoma,Arial,sans-serif}
html[dir="rtl"] body,html[dir="rtl"] button,html[dir="rtl"] input,html[dir="rtl"] textarea,html[dir="rtl"] select{font-family:var(--arabic-font)!important}
body{font-size:var(--app-font-size)}
.forgot-password-link{display:block;margin:12px auto 0;border:0;background:none;color:#9b766d;text-decoration:underline;font-size:12px;cursor:pointer}
.control-panel{max-height:90vh;overflow:auto;width:min(100%,620px)}
.control-section{padding:18px 0;border-top:1px solid #eee1d9}
.control-section h3{font:600 17px var(--arabic-font);color:var(--brown);margin-bottom:12px}
.control-section>label{display:block;margin:12px 0 7px;color:#806d64;font-size:12px}
.control-section select,.control-section input:not([type=range]){width:100%;padding:12px 14px;border:1px solid #e4d4ca;border-radius:11px;background:#fffdfb;color:#59463f;font:inherit}
.control-section input[type=range]{width:100%;accent-color:#b8877e}
.control-section input:focus,.control-section select:focus{outline:2px solid #b8877e55}
.control-hint{font-size:11px;line-height:1.8;color:#9a877d;margin:5px 0 12px}
.control-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.control-actions .outline-account{width:auto;flex:1}
.control-status{min-height:20px;color:#8d6b60;font-size:11px;margin-top:8px}
.app-lock-screen{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:24px;background:linear-gradient(145deg,#fbf7f1,#f0e2d9)}
.app-lock-screen[hidden]{display:none}
.app-lock-card{width:min(100%,390px);padding:34px 28px;border:1px solid #eadbd2;border-radius:24px;background:#fffaf5;text-align:center;box-shadow:0 25px 80px #50372c1c}
.app-lock-brand{font:26px 'Playfair Display',serif;color:#59463f;margin-bottom:20px}
.app-lock-card h2{font:30px 'Playfair Display',serif;color:#59463f;margin-bottom:8px}
.app-lock-card p{font-size:12px;line-height:1.8;color:#8f7b71;margin:10px 0}
.app-lock-card input{width:100%;padding:14px;border:1px solid #e4d4ca;border-radius:11px;text-align:center;letter-spacing:5px;font-size:20px}
.app-lock-card button{width:100%;margin-top:12px;padding:13px}
.app-lock-card #unlockMessage{min-height:20px;color:#a15f58}
html[data-theme="dark"]{--bg:#201e1c;--paper:#292522;--cream:#39312d;--brown:#eee3db;--muted:#b8a69b;--line:#49403b}
html[data-theme="dark"] body,html[data-theme="dark"] .main-content{background:#201e1c;color:#eee3db}
html[data-theme="dark"] .sidebar,html[data-theme="dark"] .settings-card,html[data-theme="dark"] .account-card,html[data-theme="dark"] .book-modal{background:#292522;color:#eee3db;border-color:#49403b}
html[data-theme="dark"] .settings-card h2,html[data-theme="dark"] .control-section h3,html[data-theme="dark"] .account-card h2{color:#eee3db}
html[data-theme="dark"] .control-section select,html[data-theme="dark"] .control-section input:not([type=range]),html[data-theme="dark"] .account-card input{background:#201e1c;color:#eee3db;border-color:#49403b}
html[data-theme="dark"] .settings-trigger{background:#292522;color:#eee3db;border-color:#49403b}
html[data-theme="dark"] .app-lock-screen{background:#201e1c}
html[data-theme="dark"] .app-lock-card{background:#292522;border-color:#49403b}
html[data-theme="dark"] .app-lock-card h2,html[data-theme="dark"] .app-lock-brand{color:#eee3db}

/* THE HOME — mobile-first editorial refresh */
:root{--app-font:'DM Sans',sans-serif;--app-font-size:100%}
body{font-family:var(--app-font);font-size:var(--app-font-size);background:radial-gradient(ellipse at 8% 5%,rgba(220,190,178,.24),transparent 34%),radial-gradient(ellipse at 92% 28%,rgba(190,203,184,.22),transparent 32%),var(--bg)}
.brand-line{white-space:nowrap!important;display:flex;align-items:center;justify-content:center;gap:9px;font-size:clamp(34px,7vw,58px)!important;letter-spacing:-1.5px!important}
.welcome-screen{isolation:isolate;overflow:hidden;background:linear-gradient(135deg,#f5eee8 0%,#f8f4ee 42%,#e8e5dc 100%)}
.welcome-screen:before,.welcome-screen:after{content:"";position:absolute;z-index:-1;border-radius:50%;filter:blur(2px);pointer-events:none}
.welcome-screen:before{width:340px;height:340px;right:-100px;top:10%;background:radial-gradient(circle,rgba(190,151,137,.28),rgba(190,151,137,0) 70%);animation:homeFloat 12s ease-in-out infinite}
.welcome-screen:after{width:420px;height:420px;left:-150px;bottom:-120px;background:radial-gradient(circle,rgba(139,158,130,.23),rgba(139,158,130,0) 70%);animation:homeFloat 16s ease-in-out infinite reverse}
.welcome-glow{border-radius:50%;filter:blur(1px);opacity:.6;animation:homeDrift 14s ease-in-out infinite alternate}
.welcome-content{animation:homeRise 1s cubic-bezier(.2,.75,.2,1) both}
.welcome-content h1{white-space:nowrap;font-size:clamp(34px,8vw,68px)!important;letter-spacing:-2px!important;display:flex;justify-content:center;align-items:center;gap:8px}
.welcome-content p{max-width:520px;line-height:1.9}
.welcome-enter,.dark-button{box-shadow:0 14px 30px rgba(81,68,62,.14);transition:transform .25s ease,box-shadow .25s ease}
.welcome-enter:active,.dark-button:active{transform:scale(.97)}
.hero-visual,.hero-photo,.collection-art,.little-note,.together-counter{box-shadow:0 20px 55px rgba(78,62,52,.08)}
.hero-photo{border-radius:34px;overflow:hidden;transform:rotate(1deg);transition:transform .6s cubic-bezier(.2,.8,.2,1)}
.hero-photo:hover{transform:rotate(0) translateY(-5px)}
.photo-decoration{animation:homeFloat 7s ease-in-out infinite}
.decoration-flower{animation-delay:-3s}
.collection-art{border-radius:24px;transition:transform .35s ease,box-shadow .35s ease}
.collection-card:active .collection-art{transform:scale(.97)}
/* Settings are a dedicated full-screen page, not a small popup */
.settings-overlay{position:fixed;inset:0;z-index:1000;background:rgba(34,29,27,.48);backdrop-filter:blur(12px);padding:0;display:none;overflow-y:auto}
.settings-overlay.open{display:block;animation:settingsFade .22s ease both}
.settings-card.control-panel{position:relative;width:min(920px,100%);min-height:100dvh;margin:0 auto;border:0;border-radius:0;padding:clamp(24px,5vw,58px);background:linear-gradient(150deg,#fffdf9,#f4eee8 70%,#eeeee6);box-shadow:none;overflow:visible;animation:settingsRise .35s cubic-bezier(.2,.75,.2,1) both}
.settings-card.control-panel:before{content:"";position:absolute;inset:0 0 auto;height:7px;background:linear-gradient(90deg,#b88f83,#d8b8a9,#a5b19b,#b88f83)}
.settings-card.control-panel h2{font-size:clamp(32px,5vw,48px);margin:12px 0 8px;letter-spacing:-1px}
.settings-card.control-panel>p{line-height:1.8;color:var(--muted);max-width:580px}
.settings-close{position:sticky;top:12px;float:right;z-index:2;width:46px;height:46px;border-radius:50%;border:1px solid rgba(81,68,62,.12);background:#fffaf5;box-shadow:0 8px 22px rgba(70,50,40,.08);font-size:28px}
.control-section{background:rgba(255,255,255,.76)!important;border:1px solid rgba(181,151,137,.18)!important;border-radius:24px!important;padding:23px!important;margin:20px 0!important;box-shadow:0 12px 34px rgba(85,65,54,.045)}
.control-section h3{font-size:19px;margin-bottom:16px}
.control-section label{display:block;margin:15px 0 8px;font-weight:600}
.control-section select,.control-section input:not([type=range]){width:100%;min-height:48px;border-radius:14px;border:1px solid #e5d9d0;background:#fffdfa;padding:0 14px;color:var(--brown)}
.control-actions,.settings-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
.settings-nav-link{border:0;text-align:inherit;background:transparent;color:inherit}
.settings-nav-link:hover{background:rgba(185,145,132,.13)}
.app-layout{animation:homeRise .7s ease both}
/* phone is the primary experience */
@media(max-width:700px){
 .app-layout{padding-bottom:calc(82px + env(safe-area-inset-bottom))}
 .sidebar{position:sticky;top:0;z-index:50;background:rgba(247,244,239,.92);backdrop-filter:blur(18px);padding:12px 15px 9px;border-bottom:1px solid rgba(160,130,115,.16)}
 .brand{font-size:21px;justify-content:center;gap:8px}
 .brand-icon{width:30px;height:30px}
 .navigation{position:fixed;z-index:100;left:12px;right:12px;bottom:calc(10px + env(safe-area-inset-bottom));margin:0;padding:9px 7px;display:flex;justify-content:space-around;gap:3px;overflow-x:auto;border:1px solid rgba(178,150,136,.22);border-radius:23px;background:rgba(255,252,247,.94);backdrop-filter:blur(22px);box-shadow:0 12px 38px rgba(60,45,38,.16)}
 .nav-link{min-width:0;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px 4px;border-radius:15px;font-size:10px;white-space:nowrap}
 .nav-link span:first-child{font-size:17px}
 .nav-badge{display:none}
 .main-content{padding:0 5%}
 .topbar{padding:17px 0;min-height:75px}
 .topbar h2{font-size:23px}
 .hero-section{padding:30px 0 36px;gap:25px}
 .hero-copy h1{font-size:clamp(36px,10vw,48px);line-height:1.2}
 .hero-copy p{font-size:14px;line-height:1.9}
 .hero-photo{height:clamp(270px,82vw,390px);border-radius:27px}
 .little-note{padding:17px;border-radius:20px;gap:12px}
 .collection-section{padding-top:35px}
 .settings-card.control-panel{padding:25px 17px calc(35px + env(safe-area-inset-bottom));min-height:100dvh}
 .settings-card.control-panel h2{font-size:32px}
 .control-section{padding:18px!important;border-radius:20px!important}
 .control-actions>* ,.settings-actions>*{flex:1;min-height:46px}
 .settings-language{padding:18px 4px;display:flex;justify-content:space-between;align-items:center}
 .welcome-content{padding:48px 0}
 .welcome-content h1{font-size:clamp(30px,8vw,44px)!important;letter-spacing:-1.5px!important;gap:5px}
 .welcome-content p{font-size:14px;max-width:330px}
 .welcome-bottom{max-width:90%;margin:auto;text-align:center}
}
@media(max-width:360px){.welcome-content h1{font-size:29px!important}.nav-link{font-size:9px}.nav-link span:first-child{font-size:15px}}
@keyframes homeFloat{0%,100%{transform:translate3d(0,0,0)}50%{transform:translate3d(0,-18px,0)}}
@keyframes homeDrift{0%{transform:translate3d(-12px,8px,0) scale(.96)}100%{transform:translate3d(18px,-15px,0) scale(1.06)}}
@keyframes homeRise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}
@keyframes settingsFade{from{opacity:0}to{opacity:1}}
@keyframes settingsRise{from{opacity:0;transform:translateY(22px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.welcome-glow,.welcome-content,.photo-decoration,.hero-photo,.app-layout{animation:none!important;transition:none!important}}

/* THE HOME — richer, animated editorial atmosphere */
:root{--app-font:'DM Sans',sans-serif}
body,body button,body input,body textarea,body select,body p,body h1,body h2,body h3,body h4,body label,body small,body span{font-family:var(--app-font)!important}
.welcome-screen{isolation:isolate}
.welcome-screen:before{animation:orbitSlow 34s linear infinite}
.welcome-screen:after{animation:orbitSlow 42s linear infinite reverse}
.welcome-screen .welcome-content:before,.welcome-screen .welcome-content:after{content:"✧";position:absolute;color:#b88f83;font-size:clamp(24px,4vw,44px);opacity:.62;pointer-events:none;animation:twinkle 4s ease-in-out infinite}
.welcome-screen .welcome-content:before{top:5%;left:7%}.welcome-screen .welcome-content:after{right:6%;bottom:7%;animation-delay:1.7s}
.welcome-mark{display:inline-grid;place-items:center;width:58px;height:58px;border:1px solid #c9a79b88;border-radius:50%;box-shadow:0 0 0 9px #ffffff30,0 15px 35px #79594b15;animation:markBreath 5s ease-in-out infinite}
.welcome-content h1{text-shadow:0 8px 35px #8b6c5c18}
.welcome-enter{position:relative;overflow:hidden}.welcome-enter:before{content:"";position:absolute;inset:-80% auto -80% -35%;width:30%;transform:rotate(25deg);background:linear-gradient(90deg,transparent,#ffffff55,transparent);animation:buttonShine 5s ease-in-out infinite}
.main-content{position:relative;isolation:isolate}
.main-content:before,.main-content:after{content:"";position:fixed;z-index:-1;pointer-events:none;border-radius:50%;filter:blur(2px);opacity:.45}
.main-content:before{width:240px;height:240px;top:16%;right:-145px;border:1px solid #cba99b66;box-shadow:0 0 0 22px #e8d9ce22,0 0 0 48px #e8d9ce15;animation:homeFloat 11s ease-in-out infinite}
.main-content:after{width:170px;height:170px;bottom:13%;left:-115px;border:1px solid #aab69a77;box-shadow:0 0 0 18px #dbe0d522,0 0 0 40px #dbe0d515;animation:homeDrift 13s ease-in-out infinite alternate}
.hero-section{position:relative}
.hero-copy{position:relative}.hero-copy:after{content:"✧";position:absolute;top:-30px;right:4%;font-size:42px;color:#c19a8f;opacity:.7;animation:twinkle 5s ease-in-out infinite}
.hero-photo{box-shadow:0 25px 70px #5b44351c,0 0 0 9px #fffaf5,0 0 0 10px #dfc9bd;transition:transform .7s cubic-bezier(.2,.8,.2,1),box-shadow .7s}
.hero-photo:hover{transform:translateY(-8px) rotate(.7deg);box-shadow:0 35px 85px #5b443528,0 0 0 9px #fffaf5,0 0 0 11px #c9a79b}
.collection-card,.little-note,.media-item,.entry-card{transition:transform .35s ease,box-shadow .35s ease}
.collection-card:hover,.little-note:hover,.media-item:hover,.entry-card:hover{transform:translateY(-6px);box-shadow:0 20px 48px #59433818}
.collection-card{position:relative;overflow:hidden}.collection-card:after{content:"";position:absolute;inset:auto -25% -60% auto;width:170px;height:170px;border:1px solid #c59e9144;border-radius:50%;box-shadow:0 0 0 18px #c59e9110,0 0 0 38px #c59e9109;pointer-events:none}
.section-kicker{letter-spacing:2.4px}
.backup-heading{display:flex;align-items:flex-start;gap:14px}.backup-icon{flex:0 0 48px;width:48px;height:48px;display:grid;place-items:center;border-radius:16px;background:linear-gradient(145deg,#f0e2d9,#e6ece3);color:#876a60;font-size:26px;animation:backupPulse 4s ease-in-out infinite}.backup-heading h3{margin:0 0 6px}.backup-heading .control-hint{margin:0}.backup-status{margin:17px 0;padding:13px 15px;border-radius:13px;background:#edf1e9;color:#61745c;font-size:12px;line-height:1.6}.backup-actions{display:flex;flex-wrap:wrap;gap:9px}.backup-actions>*{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 14px;border:1px solid #ddc9be;border-radius:13px;background:#fffdfa;color:#785e55;font-size:12px;text-decoration:none;cursor:pointer}.backup-actions>*:hover{background:#f5eae3}.backup-history{display:grid;gap:8px;margin-top:15px;font-size:12px;color:var(--muted)}.backup-history-line{font-weight:700;color:#8a7168}.backup-history-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid #eee3dc;border-radius:12px;background:#fffdfa}.backup-history-item button{border:0;background:#f1e6df;color:#775d54;padding:7px 12px;border-radius:9px;cursor:pointer}.backup-note{margin-top:14px!important;font-size:11px!important;line-height:1.8!important}
.font-live-preview{margin:12px 0 18px;padding:17px 15px;border:1px solid #e8d9cf;border-radius:15px;background:linear-gradient(120deg,#fffdfa,#f5eee8);font-size:19px;text-align:center;color:#745a51;transition:font-family .2s}
html[dir="rtl"] .backup-heading{text-align:right}html[dir="rtl"] .backup-history-item{direction:rtl}
@keyframes orbitSlow{to{transform:rotate(340deg)}}@keyframes twinkle{0%,100%{opacity:.35;transform:scale(.85) rotate(-10deg)}50%{opacity:.9;transform:scale(1.15) rotate(15deg)}}@keyframes markBreath{0%,100%{transform:translateY(0);box-shadow:0 0 0 9px #ffffff30,0 15px 35px #79594b15}50%{transform:translateY(-5px);box-shadow:0 0 0 13px #ffffff20,0 20px 40px #79594b20}}@keyframes buttonShine{0%,60%,100%{left:-40%}75%{left:120%}}@keyframes backupPulse{0%,100%{transform:rotate(-5deg) scale(1)}50%{transform:rotate(5deg) scale(1.06)}}
@media(max-width:700px){.main-content:before,.main-content:after{position:absolute;opacity:.25}.hero-copy:after{top:-18px;font-size:30px}.backup-actions>*{flex:1 1 42%;font-size:11px}.backup-history-item{font-size:11px}.font-live-preview{font-size:17px}}
@media(prefers-reduced-motion:reduce){.welcome-screen:before,.welcome-screen:after,.welcome-content:before,.welcome-content:after,.welcome-mark,.welcome-enter:before,.main-content:before,.main-content:after,.hero-copy:after,.backup-icon{animation:none!important}}
/* Every text-bearing element follows the selected font, including cards and controls. */
body *{font-family:var(--app-font)!important}


/* =========================================================
   PREMIUM REDESIGN — The Home
   ========================================================= */
:root{
  --bg:#f5f1ec; --paper:rgba(255,253,250,.78); --ink:#302725; --brown:#4e403b;
  --rose:#b77d77; --rose-2:#d8aaa3; --gold:#b79b72; --muted:#9c8f87; --line:rgba(96,73,65,.13);
  --glass:rgba(255,255,255,.52); --shadow:0 24px 70px rgba(64,44,37,.12); --radius:28px;
  --app-font-size:100%;
}
body{font-size:calc(16px * var(--app-font-size)/100); overflow-x:hidden; background:
 radial-gradient(circle at 10% 10%,rgba(211,168,157,.18),transparent 28%),
 radial-gradient(circle at 90% 15%,rgba(186,158,119,.14),transparent 30%),
 linear-gradient(135deg,#f7f3ee 0%,#f2ece6 48%,#f8f4f0 100%);}
body:before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.28;z-index:-2;background-image:radial-gradient(rgba(85,63,56,.18) .7px,transparent .7px);background-size:8px 8px;mask-image:linear-gradient(to bottom,black,transparent 80%)}
.ambient-scene{position:fixed;inset:0;pointer-events:none;z-index:-1;overflow:hidden}
.orb{position:absolute;border-radius:50%;filter:blur(1px);opacity:.5;animation:orbFloat 12s ease-in-out infinite}
.orb-a{width:300px;height:300px;left:-110px;top:18%;background:radial-gradient(circle at 40% 40%,rgba(207,143,139,.35),transparent 68%)}
.orb-b{width:380px;height:380px;right:-170px;top:42%;background:radial-gradient(circle at 45% 45%,rgba(193,167,123,.26),transparent 68%);animation-delay:-4s}
.orb-c{width:240px;height:240px;right:30%;bottom:-120px;background:radial-gradient(circle,rgba(180,139,153,.22),transparent 68%);animation-delay:-8s}
.spark{position:absolute;color:rgba(169,122,116,.45);font-size:20px;animation:sparkFloat 6s ease-in-out infinite}
.spark-1{left:24%;top:16%}.spark-2{right:24%;top:24%;animation-delay:-2s}.spark-3{left:12%;bottom:22%;font-size:40px;animation-delay:-4s}.spark-4{right:12%;bottom:16%;animation-delay:-1s}
@keyframes orbFloat{0%,100%{transform:translate3d(0,0,0) scale(1)}50%{transform:translate3d(18px,-24px,0) scale(1.06)}}
@keyframes sparkFloat{0%,100%{transform:translateY(0) rotate(0);opacity:.25}50%{transform:translateY(-16px) rotate(12deg);opacity:.8}}
.app-layout{max-width:1700px;min-height:100vh;grid-template-columns:280px minmax(0,1fr);position:relative}
.sidebar{position:sticky;top:0;height:100vh;padding:30px 22px 22px;background:rgba(248,244,239,.72);backdrop-filter:blur(22px) saturate(130%);border-right:1px solid var(--line);box-shadow:10px 0 40px rgba(72,52,46,.04);z-index:5}
.brand{font-family:'DM Serif Display','Playfair Display',serif;font-size:28px;letter-spacing:-.5px;color:var(--ink)}
.brand-icon{width:42px;height:42px;border:1px solid rgba(183,125,119,.55);background:rgba(255,255,255,.42);box-shadow:0 8px 25px rgba(183,125,119,.12)}
.sidebar-label{margin:58px 0 16px;font-weight:700;letter-spacing:2.8px}
.navigation{gap:6px}.nav-link{border-radius:16px;padding:14px 15px;transition:.25s ease;position:relative}.nav-link:after{content:"";position:absolute;inset:0;border-radius:inherit;border:1px solid transparent;transition:.25s}.nav-link:hover:after,.nav-link.active:after{border-color:rgba(183,125,119,.2)}
.nav-link:hover,.nav-link.active{background:linear-gradient(135deg,rgba(255,255,255,.7),rgba(236,220,214,.72));box-shadow:0 10px 28px rgba(80,58,52,.07);transform:translateX(2px)}
.nav-link > span:first-child{color:var(--rose)}
.sidebar-quote{border:1px solid var(--line);border-radius:20px;background:linear-gradient(145deg,rgba(239,225,216,.7),rgba(255,250,246,.55));box-shadow:inset 0 1px rgba(255,255,255,.8);position:relative;overflow:hidden}
.sidebar-quote:after{content:"";position:absolute;width:100px;height:100px;border-radius:50%;right:-40px;top:-35px;background:rgba(183,125,119,.12)}
.install-hint{display:block;margin-top:8px;font-size:9px;line-height:1.5;color:#aaa09a}
.main-content{padding:0 clamp(24px,6vw,90px)}
.topbar{min-height:96px;border-bottom:1px solid var(--line);position:relative}.topbar:after{content:"";position:absolute;bottom:-1px;left:0;width:130px;height:2px;background:linear-gradient(90deg,var(--rose),transparent)}
.topbar h2{font-family:'DM Serif Display','Playfair Display',serif;font-size:28px;letter-spacing:-.3px}.top-right{gap:12px}.settings-trigger{border:1px solid var(--line);background:rgba(255,255,255,.55);padding:10px 14px;border-radius:999px;color:var(--brown);transition:.25s}.settings-trigger:hover{transform:translateY(-2px);box-shadow:0 12px 30px rgba(67,48,42,.1)}
.hero-section{padding:72px 0 82px;gap:70px;min-height:680px}.hero-copy{position:relative;z-index:2}.section-kicker{letter-spacing:3px;font-size:9px;color:var(--rose);font-weight:800}.hero-copy h1{font-family:'DM Serif Display','Playfair Display',serif;font-size:clamp(50px,6vw,88px);line-height:1.02;letter-spacing:-2px;text-shadow:0 8px 40px rgba(80,53,46,.08)}.hero-copy h1 i{position:relative;color:var(--rose);font-style:italic}.hero-copy h1 i:after{content:"";position:absolute;left:2px;right:4px;bottom:-8px;height:9px;border-bottom:2px solid rgba(183,125,119,.35);border-radius:50%}.hero-copy>p{font-size:14px;line-height:2.05;max-width:440px;color:#8f817a}.dark-button,.outline-button{border-radius:999px!important;padding:14px 20px!important;box-shadow:0 12px 30px rgba(64,43,38,.13);transition:.25s ease}.dark-button{background:linear-gradient(135deg,#4c3b36,#2e2421)!important}.dark-button:hover,.outline-button:hover{transform:translateY(-3px);box-shadow:0 18px 38px rgba(64,43,38,.18)}
.hero-signature{font-family:'Caveat',cursive;font-size:22px;color:#8d7069;transform:rotate(-2deg)}
.hero-visual{position:relative;min-height:590px}.hero-photo{border-radius:34px;padding:12px;background:rgba(255,255,255,.55);border:1px solid rgba(255,255,255,.8);box-shadow:var(--shadow);transform:rotate(1deg);transition:.4s}.hero-photo:hover{transform:rotate(0deg) translateY(-5px)}.hero-photo:before{content:"";position:absolute;inset:20px -16px -16px 20px;border-radius:34px;background:linear-gradient(135deg,rgba(183,125,119,.25),rgba(183,155,114,.18));filter:blur(18px);z-index:-1}
.hero-photo img{border-radius:25px}.photo-caption{background:rgba(255,253,249,.82);backdrop-filter:blur(12px);border-radius:0 0 20px 20px}.photo-decoration{filter:drop-shadow(0 8px 15px rgba(60,40,35,.15));animation:decorFloat 4s ease-in-out infinite}.decoration-heart{font-size:38px}.decoration-flower{font-size:32px;animation-delay:-2s}@keyframes decorFloat{0%,100%{transform:translateY(0) rotate(-4deg)}50%{transform:translateY(-10px) rotate(4deg)}}
.together-counter{border:1px solid rgba(183,125,119,.25);background:rgba(255,253,250,.72);backdrop-filter:blur(16px);border-radius:24px;box-shadow:0 18px 50px rgba(67,47,41,.1);animation:counterFloat 5s ease-in-out infinite}.counter-numbers strong{font-size:32px}
.little-note,.collection-card,.book-preview,.simple-section,.media-item{border:1px solid var(--line);background:rgba(255,253,250,.58);backdrop-filter:blur(15px);box-shadow:0 18px 55px rgba(65,45,40,.07)}
.little-note{border-radius:22px}.collection-section{padding:75px 0}.section-heading h2,.book-preview h2,.simple-section h2{font-family:'DM Serif Display','Playfair Display',serif;font-size:46px;letter-spacing:-1px}.collection-grid{gap:22px}.collection-card{border-radius:25px;overflow:hidden;transition:.35s}.collection-card:hover{transform:translateY(-8px) rotate(-.4deg);box-shadow:0 25px 70px rgba(65,45,40,.13)}.collection-art{min-height:210px;background:linear-gradient(145deg,rgba(226,205,197,.72),rgba(246,237,229,.5));position:relative;overflow:hidden}.collection-art:before{content:"";position:absolute;width:180px;height:180px;border-radius:50%;right:-40px;top:-60px;background:rgba(255,255,255,.45)}.book-art:after,.gallery-art:after,.voice-art:after{content:"";position:absolute;inset:20px;border:1px dashed rgba(183,125,119,.25);border-radius:20px}.art-book{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-6deg);font-family:'DM Serif Display',serif;font-size:28px;text-align:center;line-height:.9;color:#634f49;z-index:1}.art-flower{position:absolute;right:24%;bottom:20%;font-size:35px;color:var(--rose);animation:decorFloat 5s ease-in-out infinite}.gallery-art span,.voice-art span{position:absolute;inset:0;display:grid;place-items:center;font-size:65px;color:rgba(183,125,119,.65);z-index:1}.collection-info{padding:20px 20px 22px}.collection-info h3{font-family:'DM Serif Display','Playfair Display',serif;font-size:22px}.collection-info p{color:#948780;margin-top:5px}.book-preview{border-radius:34px;overflow:hidden;position:relative}.book-preview:before{content:"";position:absolute;width:320px;height:320px;border-radius:50%;right:-120px;top:-140px;background:rgba(183,125,119,.11)}.book-cover{transform:rotate(4deg);box-shadow:0 28px 70px rgba(55,38,34,.18);border-radius:4px!important}.simple-section{margin:60px 0;padding:70px 40px;border-radius:30px}.main-footer{padding:45px 0 60px;border-top:1px solid var(--line);margin-top:50px}
.media-section{padding:70px 0}.media-grid{gap:22px}.media-item{border-radius:22px}.media-item:hover{transform:translateY(-5px);transition:.25s;box-shadow:0 24px 60px rgba(65,45,40,.12)}.media-item img,.media-item video{border-radius:15px}
/* settings becomes a true full-page control center */
.settings-overlay{position:fixed;inset:0;background:rgba(246,241,236,.96);backdrop-filter:blur(24px);z-index:1000;display:none;overflow:auto;padding:0}.settings-overlay.open{display:block}.settings-card.control-panel{width:min(1100px,calc(100% - 48px));min-height:100vh;margin:0 auto;border-radius:0;background:transparent;box-shadow:none;padding:50px 0 90px;position:relative}.settings-card.control-panel:before{content:"CONTROL CENTER";position:absolute;right:0;top:58px;font-size:9px;letter-spacing:3px;color:#b5a39c}.settings-card h2{font-family:'DM Serif Display','Playfair Display',serif;font-size:64px!important;line-height:1;color:var(--ink);margin-top:10px}.settings-card>p{font-size:15px!important;color:#8d8079!important;max-width:620px}.settings-close{position:fixed;top:26px;left:28px;width:48px;height:48px;border-radius:50%;border:1px solid var(--line);background:rgba(255,255,255,.7);font-size:20px;color:var(--brown);z-index:3}.control-section{border:1px solid var(--line)!important;border-radius:25px!important;background:rgba(255,255,255,.52)!important;box-shadow:0 20px 60px rgba(65,45,40,.07)!important;padding:28px!important;margin-top:18px}.control-section h3{font-family:'DM Serif Display','Playfair Display',serif;font-size:25px}.control-section select,.control-section input{border:1px solid rgba(94,72,64,.16);background:rgba(255,255,255,.8);border-radius:14px;padding:13px 14px}.font-live-preview{border-radius:18px;background:linear-gradient(135deg,rgba(235,218,211,.45),rgba(255,255,255,.7));border:1px solid var(--line);font-size:28px!important;padding:22px!important}.settings-photo-preview{border-radius:22px!important;border:1px solid var(--line)!important;background:rgba(255,255,255,.55)!important}.backup-section{margin-bottom:20px}.settings-language{margin-top:18px;padding:20px;border:1px solid var(--line);border-radius:20px;background:rgba(255,255,255,.45)}
/* RTL polish */
html[dir="rtl"] body{font-family:var(--arabic-font,'Cairo',Tahoma,sans-serif)}html[dir="rtl"] .main-content{direction:rtl}html[dir="rtl"] .nav-link{text-align:right}html[dir="rtl"] .nav-badge{margin-left:0;margin-right:auto}html[dir="rtl"] .topbar,html[dir="rtl"] .section-heading{direction:rtl}html[dir="rtl"] .hero-copy{text-align:right}html[dir="rtl"] .hero-copy h1 i:after{left:auto;right:2px}html[dir="rtl"] .settings-close{left:auto;right:28px}html[dir="rtl"] .settings-card.control-panel:before{right:auto;left:0}
/* mobile-first app experience */
@media (max-width:900px){
 .app-layout{display:block}.sidebar{position:fixed;left:0;right:0;bottom:0;top:auto;width:100%;height:76px;min-height:0;padding:8px 10px;border-right:0;border-top:1px solid var(--line);display:block;backdrop-filter:blur(22px);z-index:50}.sidebar .brand,.sidebar-label,.sidebar-bottom{display:none}.navigation{height:100%;display:grid;grid-template-columns:repeat(7,1fr);gap:3px}.nav-link{justify-content:center;flex-direction:column;gap:2px;padding:6px 2px;border-radius:14px;font-size:9px}.nav-link>span:first-child{width:auto;font-size:18px}.nav-link .nav-badge{position:absolute;top:4px;right:18%;margin:0}.main-content{padding:0 18px 100px}.topbar{min-height:84px}.top-right>span:not(.online-dot),.settings-trigger{display:none}.hero-section{grid-template-columns:1fr;gap:30px;padding:48px 0 58px;min-height:auto}.hero-copy h1{font-size:clamp(44px,13vw,64px)}.hero-copy>p{font-size:13px}.hero-visual{min-height:470px}.hero-photo{max-width:100%}.collection-section,.media-section{padding:55px 0}.collection-grid,.media-grid{grid-template-columns:1fr}.section-heading h2,.book-preview h2,.simple-section h2{font-size:38px}.book-preview{padding:28px!important}.book-illustration{min-height:360px}.settings-card.control-panel{width:100%;padding:90px 18px 120px}.settings-card h2{font-size:48px!important}.settings-card.control-panel:before{display:none}.settings-close{top:18px;left:18px}html[dir="rtl"] .settings-close{right:18px;left:auto}
}
@media (max-width:520px){.brand-line{font-size:56px!important}.hero-copy h1{letter-spacing:-1px}.hero-signature{font-size:19px}.together-counter{margin-top:-8px}.collection-card{border-radius:20px}.simple-section{padding:48px 24px}.control-section{padding:20px!important}.font-live-preview{font-size:23px!important}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* PREMIUM WELCOME HERO — brand treatment */
.welcome-content { position: relative; }
.welcome-content h1.brand-line {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px auto 26px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(44px, 8vw, 86px) !important;
  line-height: 1;
  letter-spacing: -2px !important;
  color: #58453e;
  text-shadow: 0 10px 35px rgba(103,76,66,.12);
}
.welcome-content h1.brand-line .brand-name {
  display: inline-block;
}
.welcome-content h1.brand-line .brand-emojis {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: system-ui, sans-serif;
  font-size: .52em;
  letter-spacing: 0;
  transform: translateY(1px);
  filter: drop-shadow(0 7px 12px rgba(104,73,63,.15));
  animation: emojiHeartbeat 2.8s ease-in-out infinite;
}
.welcome-content h1.brand-line .brand-emojis::after {
  content: '';
  position: absolute;
  width: 105px; height: 105px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(221,174,160,.22), transparent 68%);
  z-index: -1;
  animation: haloPulse 3.8s ease-in-out infinite;
}
.welcome-content::before, .welcome-content::after { z-index: -1; }

/* Extra living details on the welcome screen */
.welcome-screen .welcome-glow { animation: glowDrift 9s ease-in-out infinite alternate; }
.welcome-screen .glow-two { animation-delay: -3s; }
.welcome-screen .spark {
  position: absolute; z-index: 0; pointer-events: none;
  color: #b88f83; opacity: .55;
  animation: sparkleFloat 5s ease-in-out infinite;
}
@keyframes emojiHeartbeat {
  0%,100% { transform: translateY(1px) scale(1); }
  10% { transform: translateY(1px) scale(1.08); }
  18% { transform: translateY(1px) scale(1); }
  26% { transform: translateY(1px) scale(1.06); }
  34% { transform: translateY(1px) scale(1); }
}
@keyframes haloPulse {
  0%,100% { transform: scale(.85); opacity: .35; }
  50% { transform: scale(1.15); opacity: .7; }
}
@keyframes glowDrift {
  0% { transform: translate3d(-12px, 8px, 0) scale(.95); }
  50% { transform: translate3d(22px, -18px, 0) scale(1.08); }
  100% { transform: translate3d(-5px, 20px, 0) scale(1); }
}
@keyframes sparkleFloat {
  0%,100% { transform: translateY(0) rotate(0deg); opacity: .35; }
  50% { transform: translateY(-14px) rotate(12deg); opacity: .9; }
}
html[dir="rtl"] .welcome-content h1.brand-line {
  font-family: 'Cairo', sans-serif;
  letter-spacing: 0 !important;
  gap: 10px;
}
html[dir="rtl"] .welcome-content h1.brand-line .brand-emojis {
  font-family: system-ui, sans-serif;
}
@media(max-width:700px){
  .welcome-content h1.brand-line { font-size: clamp(34px, 12vw, 58px) !important; gap: 9px; }
  .welcome-content h1.brand-line .brand-emojis { font-size: .5em; }
}


/* ===== RESPONSIVE + MOBILE PERFORMANCE PATCH ===== */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100dvh;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

img, video, canvas, svg {
    max-width: 100%;
}

button, a, input, textarea, select {
    touch-action: manipulation;
}

.app-layout,
.main-content,
.hero-section,
.hero-copy,
.hero-visual,
.collection-grid,
.media-grid,
.settings-card.control-panel {
    min-width: 0;
}

/* Keep the phone experience fluid instead of forcing desktop dimensions. */
@media (max-width: 900px) {
    html { overflow-x: hidden; }

    .app-layout {
        width: 100%;
        max-width: 100%;
        min-height: 100dvh;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
        padding-left: clamp(14px, 4vw, 24px);
        padding-right: clamp(14px, 4vw, 24px);
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .topbar {
        min-height: 76px;
        gap: 12px;
        padding: 12px 0;
    }

    .topbar h2 { font-size: clamp(20px, 6vw, 28px); }
    .top-date { font-size: 8px; letter-spacing: 1.5px; }

    .hero-section {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        gap: clamp(24px, 7vw, 40px);
        padding: clamp(34px, 8vw, 58px) 0 clamp(42px, 10vw, 70px);
    }

    .hero-copy h1 {
        max-width: 100%;
        font-size: clamp(39px, 12vw, 64px);
        overflow-wrap: anywhere;
    }

    .hero-copy > p { max-width: 100%; }

    .hero-visual {
        width: 100%;
        min-height: 0;
    }

    .hero-photo {
        width: 100%;
        max-width: 100%;
        transform: none;
    }

    .hero-photo:hover { transform: none; }

    .hero-photo img {
        display: block;
        width: 100%;
        height: auto;
        max-height: 62vh;
        object-fit: cover;
    }

    .photo-caption {
        padding: 12px 14px;
    }

    .photo-decoration { display: none; }

    .together-counter {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        margin: 14px 0 0;
        animation: none;
    }

    .collection-section,
    .media-section { padding: 48px 0; }

    .collection-grid,
    .media-grid {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
    }

    .collection-card,
    .media-item,
    .book-preview,
    .simple-section { min-width: 0; }

    .settings-card.control-panel {
        width: 100%;
        max-width: 100%;
        padding: 82px 16px calc(110px + env(safe-area-inset-bottom));
    }

    .settings-card h2 {
        font-size: clamp(40px, 12vw, 56px) !important;
        overflow-wrap: anywhere;
    }

    .settings-card.control-panel:before { display: none; }

    .control-section {
        width: 100%;
        padding: clamp(18px, 5vw, 28px) !important;
    }

    .settings-close {
        top: calc(14px + env(safe-area-inset-top));
        left: 14px;
    }

    html[dir="rtl"] .settings-close {
        left: auto;
        right: 14px;
    }

    /* 16px prevents iOS Safari from zooming into form controls. */
    input, textarea, select {
        font-size: 16px !important;
    }

    .sidebar {
        height: calc(72px + env(safe-area-inset-bottom));
        padding: 7px 8px env(safe-area-inset-bottom);
    }

    .navigation {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        width: 100%;
    }

    .nav-link {
        min-width: 0;
        padding: 6px 1px;
        font-size: clamp(7px, 2.2vw, 9px);
        overflow: hidden;
    }

    .nav-link > span:first-child { font-size: clamp(16px, 5vw, 20px); }
    .nav-link > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}

@media (max-width: 520px) {
    .main-content { padding-left: 13px; padding-right: 13px; }

    .topbar {
        align-items: flex-start;
        min-height: 70px;
    }

    .topbar h2 { font-size: 21px; }
    .top-right { display: none !important; }

    .hero-section { padding-top: 30px; }
    .hero-copy h1 { font-size: clamp(36px, 11.5vw, 54px); line-height: 1.04; }
    .hero-copy > p { font-size: 13px; line-height: 1.85; }

    .dark-button,
    .outline-button {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    .hero-signature { font-size: 19px; }

    .counter-numbers {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    .counter-numbers strong { font-size: 28px; }
    .counter-numbers small { font-size: 10px; }

    .simple-section { padding: 38px 20px; }
    .section-heading h2,
    .book-preview h2,
    .simple-section h2 { font-size: clamp(32px, 10vw, 42px); }

    .settings-card.control-panel { padding-left: 13px; padding-right: 13px; }
    .settings-card h2 { font-size: clamp(36px, 11vw, 50px) !important; }

    .sidebar {
        height: calc(68px + env(safe-area-inset-bottom));
        padding-left: 5px;
        padding-right: 5px;
    }

    .nav-link > span:first-child { font-size: 17px; }
    .nav-link { font-size: 7px; }
}

@media (max-width: 380px) {
    .main-content { padding-left: 10px; padding-right: 10px; }
    .hero-copy h1 { font-size: 34px; }
    .sidebar { height: calc(64px + env(safe-area-inset-bottom)); }
    .nav-link > span:first-child { font-size: 15px; }
    .nav-link { font-size: 6.5px; }
}

/* Reduce expensive visual effects on low-power/mobile devices while keeping the look. */
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
    .sidebar,
    .photo-caption,
    .together-counter,
    .little-note,
    .collection-card,
    .book-preview,
    .simple-section,
    .media-item,
    .settings-overlay {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

@media (max-width: 900px) {
    .ambient-scene .orb,
    .ambient-scene .spark,
    .welcome-glow,
    .welcome-screen .welcome-glow,
    .welcome-screen .spark {
        animation-duration: 14s !important;
    }
}


/* =========================================
   THE HOME — FINAL AUTH + MOBILE PERFORMANCE FIX
   ========================================= */

/* The main app must never be hidden behind the welcome transition. */
.app-layout {
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
}

.app-layout.app-ready {
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    animation: none !important;
}

/* The welcome layer is the only layer that should disappear after login. */
.welcome-screen.welcome-leaving {
    opacity: 0 !important;
    pointer-events: none !important;
}

.welcome-screen[hidden] {
    display: none !important;
}

.account-screen[hidden] {
    display: none !important;
}

/* Mobile performance: remove continuous decorative animation and GPU-heavy blur. */
@media (max-width: 768px) {
    .app-layout,
    .app-layout.app-ready {
        animation: none !important;
        filter: none !important;
        transform: none !important;
    }

    .welcome-screen:before,
    .welcome-screen:after,
    .welcome-screen .welcome-content:before,
    .welcome-screen .welcome-content:after,
    .welcome-mark,
    .welcome-enter:before,
    .welcome-glow,
    .main-content:before,
    .main-content:after,
    .hero-copy:after,
    .photo-decoration,
    .orb,
    .spark {
        animation: none !important;
    }

    .sidebar,
    .navigation,
    .settings-overlay,
    .date-setup-overlay {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .sidebar {
        background: rgba(247, 244, 239, 0.98) !important;
    }

    .navigation {
        background: rgba(255, 252, 247, 0.98) !important;
    }

    .settings-overlay {
        background: rgba(34, 29, 27, 0.72) !important;
    }

    .date-setup-overlay {
        background: rgba(63, 45, 39, 0.72) !important;
    }

    .hero-photo,
    .collection-card,
    .little-note,
    .media-item,
    .together-counter,
    .book-preview {
        box-shadow: 0 10px 30px rgba(65, 45, 40, 0.08) !important;
    }

    .hero-photo:hover,
    .collection-card:hover,
    .little-note:hover,
    .media-item:hover,
    .nav-link:hover {
        transform: none !important;
    }
}

/* Respect devices that explicitly request reduced motion. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}


/* FINAL MOBILE LAYOUT OVERRIDE — keep the phone nav horizontal and remove desktop sidebar geometry */
@media (max-width: 900px) {
  html, body { width:100% !important; max-width:100% !important; overflow-x:hidden !important; }
  .app-layout {
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-height:100dvh !important;
    grid-template-columns:none !important;
    position:relative !important;
    overflow-x:hidden !important;
  }
  .sidebar {
    position:fixed !important;
    top:auto !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    width:100% !important;
    height:calc(72px + env(safe-area-inset-bottom)) !important;
    min-height:0 !important;
    max-height:96px !important;
    padding:7px 8px env(safe-area-inset-bottom) !important;
    margin:0 !important;
    display:block !important;
    border-right:0 !important;
    border-top:1px solid var(--line) !important;
    border-bottom:0 !important;
    background:rgba(255,252,247,.98) !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
    z-index:999 !important;
    box-sizing:border-box !important;
  }
  .sidebar .brand,
  .sidebar .sidebar-label,
  .sidebar .sidebar-bottom { display:none !important; }
  .sidebar .navigation {
    display:grid !important;
    grid-template-columns:repeat(7,minmax(0,1fr)) !important;
    width:100% !important;
    height:100% !important;
    margin:0 !important;
    padding:0 !important;
    gap:2px !important;
    overflow:hidden !important;
    align-items:stretch !important;
  }
  .sidebar .nav-link {
    display:flex !important;
    min-width:0 !important;
    width:auto !important;
    height:100% !important;
    padding:5px 1px !important;
    margin:0 !important;
    justify-content:center !important;
    align-items:center !important;
    flex-direction:column !important;
    gap:2px !important;
    font-size:clamp(7px,2.2vw,10px) !important;
    transform:none !important;
  }
  .sidebar .nav-link > span:first-child { font-size:clamp(16px,5vw,21px) !important; width:auto !important; }
  .sidebar .nav-link > span:last-child { white-space:nowrap !important; overflow:hidden !important; text-overflow:ellipsis !important; max-width:100% !important; }
  .main-content {
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    padding:0 14px calc(92px + env(safe-area-inset-bottom)) !important;
    box-sizing:border-box !important;
  }
  .hero-section { grid-template-columns:1fr !important; }
}

/* Kill the remaining always-running decorative effects on phones. */
@media (max-width: 900px) {
  .ambient-scene,
  .ambient-scene .orb,
  .ambient-scene .spark,
  .welcome-glow,
  .welcome-screen .spark,
  .photo-decoration,
  .art-flower { animation:none !important; }
  .ambient-scene .orb,
  .ambient-scene .spark { display:none !important; }
  .hero-photo:before { filter:none !important; }
  .hero-photo,
  .together-counter,
  .little-note,
  .collection-card,
  .book-preview,
  .simple-section,
  .media-item,
  .photo-caption { backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }
}

/* =========================================================
   THE HOME — DEFINITIVE PHONE MODE (v8)
   This block intentionally comes last so it wins over all
   earlier desktop/mobile experiments in this stylesheet.
   ========================================================= */
@media screen and (max-width: 900px) {
  html, body {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .app-layout {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    grid-template-columns: none !important;
    overflow-x: clip !important;
  }

  /* There is only ONE navigation area on phones: the bottom bar. */
  .app-layout > .sidebar {
    position: fixed !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: calc(70px + env(safe-area-inset-bottom)) !important;
    min-height: 0 !important;
    max-height: 96px !important;
    margin: 0 !important;
    padding: 7px 6px env(safe-area-inset-bottom) !important;
    display: block !important;
    overflow: visible !important;
    border: 0 !important;
    border-top: 1px solid rgba(160,130,115,.18) !important;
    background: #fffdf9 !important;
    box-shadow: 0 -8px 28px rgba(70,50,43,.08) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 9999 !important;
  }

  .app-layout > .sidebar .brand,
  .app-layout > .sidebar .sidebar-label,
  .app-layout > .sidebar .sidebar-bottom {
    display: none !important;
  }

  .app-layout > .sidebar .navigation {
    position: static !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 2px !important;
    overflow: hidden !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .app-layout > .sidebar .nav-link {
    position: relative !important;
    width: auto !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 5px 1px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    font-size: clamp(7px, 2.2vw, 10px) !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    transform: none !important;
  }

  .app-layout > .sidebar .nav-link > span:first-child {
    width: auto !important;
    font-size: clamp(16px, 5vw, 21px) !important;
  }

  .app-layout > .sidebar .nav-link > span:last-child {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-layout > .sidebar .nav-badge { display: none !important; }

  .app-layout > .main-content {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 14px calc(88px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
  }

  .app-layout > .main-content .hero-section {
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* Remove the remaining continuous effects on phones. */
  .app-layout,
  .app-layout * {
    animation: none !important;
  }

  .app-layout .hero-photo,
  .app-layout .collection-card,
  .app-layout .little-note,
  .app-layout .media-item,
  .app-layout .book-preview,
  .app-layout .simple-section,
  .app-layout .together-counter,
  .app-layout .photo-caption {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Never leave a full-screen transition layer over the actual app. */
.app-layout.app-ready {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  animation: none !important;
}


/* =========================================================
   THE HOME — PHONE PERFORMANCE MODE v9
   Keep the design, but make the first paint cheap on phones.
   ========================================================= */
@media screen and (max-width: 900px) {
  html { scroll-behavior: auto !important; }

  /* No continuous paint work on the welcome/auth/app layers. */
  .welcome-screen,
  .welcome-screen *,
  .account-screen,
  .account-screen *,
  .app-layout,
  .app-layout * {
    animation: none !important;
  }

  /* Avoid expensive GPU blur/filter effects on mobile. */
  .welcome-screen *,
  .account-screen *,
  .app-layout * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .welcome-glow,
  .welcome-screen .spark,
  .ambient-scene,
  .ambient-scene .orb,
  .ambient-scene .spark,
  .photo-decoration,
  .art-flower {
    display: none !important;
  }

  /* Keep only the actual phone navigation at the bottom. */
  .app-layout > .sidebar {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    width: 100% !important;
    height: calc(70px + env(safe-area-inset-bottom)) !important;
    display: block !important;
    z-index: 9999 !important;
    background: #fffdf9 !important;
    transform: none !important;
  }

  .app-layout > .sidebar .navigation {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0,1fr)) !important;
    width: 100% !important;
    height: 100% !important;
  }

  .app-layout > .main-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
  }

  /* Let long sections be laid out only as they approach the viewport. */
  .collection-section,
  .media-section,
  .book-preview,
  .simple-section {
    content-visibility: auto;
    contain-intrinsic-size: 500px;
  }

  /* Keep images from forcing a huge layout/paint area. */
  .hero-photo img,
  .media-item img,
  .media-item video {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* =========================================
   THE HOME — TRUE APP PAGES
   ========================================= */
.app-page-section[hidden] {
  display: none !important;
}

.app-page-section:not([hidden]) {
  animation: pageEnter .22s ease both;
}

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-link[data-page] {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Settings is modal-like but does NOT disappear when another page is selected. */
.settings-overlay.open {
  pointer-events: none !important;
}

.settings-overlay.open .settings-card {
  pointer-events: auto !important;
}

.settings-overlay.open .settings-close {
  pointer-events: auto !important;
}

/* Do not close Settings by clicking the dimmed background. */
@media (prefers-reduced-motion: reduce) {
  .app-page-section:not([hidden]) {
    animation: none !important;
  }
}


/* =========================================
   THE HOME — PAGE NAVIGATION + SETTINGS OVERLAY FIX
   ========================================= */
.app-page-section[hidden]{display:none !important;}
.app-page-section:not([hidden]){display:block;}

/* Settings stays open while the navigation remains clickable. Only X closes it. */
.settings-overlay.open{
  pointer-events:none !important;
  background:rgba(246,241,236,.78) !important;
  backdrop-filter:blur(10px) !important;
  -webkit-backdrop-filter:blur(10px) !important;
  z-index:2000 !important;
}
.settings-overlay.open .settings-card{
  pointer-events:auto !important;
  background:rgba(255,253,250,.94) !important;
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}
.settings-overlay.open .settings-close{pointer-events:auto !important;}

@media (max-width:768px){
  .app-layout > .sidebar{z-index:3000 !important;}
  .settings-overlay.open .settings-card{
    width:100% !important;
    min-height:100vh !important;
    padding-bottom:110px !important;
  }
  .page-action-row{display:flex;gap:12px;flex-wrap:wrap;margin-top:24px;}
}
@media (min-width:769px){
  .app-layout > .sidebar{z-index:3000 !important;}
}

/* =========================================================
   THE HOME v12 — SETTINGS + MOBILE FILE PICKERS + REAL BOOK
   ========================================================= */

/* Settings is a true overlay, but the bottom navigation must remain usable. */
.settings-overlay.open {
  pointer-events: none !important;
  background: rgba(54, 43, 39, .42) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}
.settings-overlay.open .settings-card {
  pointer-events: auto !important;
  background: rgba(255, 253, 250, .96) !important;
}
.settings-close {
  cursor: pointer !important;
}

/* The phone navigation is above the dimmer, never trapped behind Settings. */
@media (max-width: 768px) {
  .app-layout > .sidebar {
    z-index: 3200 !important;
  }
  .settings-overlay.open {
    z-index: 2000 !important;
    align-items: flex-start !important;
  }
  .settings-overlay.open .settings-card.control-panel {
    width: 100% !important;
    height: calc(100vh - 94px) !important;
    min-height: 0 !important;
    max-height: calc(100vh - 94px) !important;
    margin: 0 !important;
    overflow-y: auto !important;
    padding: 72px 18px 28px !important;
    border-radius: 0 0 24px 24px !important;
  }
  .settings-overlay.open .settings-close {
    position: fixed !important;
    top: 16px !important;
    left: 18px !important;
    right: auto !important;
    z-index: 3500 !important;
  }
  html[dir="rtl"] .settings-overlay.open .settings-close {
    right: 18px !important;
    left: auto !important;
  }
}

/* Reliable mobile upload controls: actual buttons trigger the native picker. */
.photo-upload,
.settings-upload {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid #d9c4b9;
  background: rgba(255,255,255,.78);
  color: #795e55;
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.photo-upload { margin-top: 12px; font-size: 12px; }
.settings-upload { width: 100%; margin-top: 15px; font-size: 12px; }
.photo-upload:active,
.settings-upload:active,
.media-add:active { transform: scale(.98); }

/* =========================================================
   REALISTIC LITTLE BOOK
   ========================================================= */
.book-modal {
  width: min(1120px, 100%);
  max-height: 94vh;
  padding: 30px 34px 34px;
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(34, 24, 20, .28);
}
.book-modal:before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(111,76,59,.06), transparent 9%, transparent 91%, rgba(111,76,59,.05));
}
.book-toolbar { position: relative; z-index: 2; }

.book-media-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 8px;
}
.book-media-pick .outline-account {
  width: 100%;
  min-height: 46px;
}
.book-media-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 0;
  margin-top: 2px;
}
.book-media-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6eee8;
  color: #795e55;
  font-size: 10px;
}
.book-media-chip button {
  border: 0;
  background: transparent;
  color: #9a776d;
  padding: 0;
  font-size: 15px;
}

.real-book-reader {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
  margin: 22px 0 16px;
  perspective: 1800px;
  filter: drop-shadow(0 20px 38px rgba(67,48,40,.15));
}
.book-paper {
  position: relative;
  min-width: 0;
  background:
    linear-gradient(90deg, rgba(117,82,61,.12), transparent 8%),
    repeating-linear-gradient(0deg, rgba(126,92,71,.025) 0, rgba(126,92,71,.025) 1px, transparent 1px, transparent 5px),
    #fffaf0;
  border: 1px solid #e7d9c9;
  padding: 34px;
}
.left-paper {
  border-radius: 12px 2px 2px 12px;
  border-right: 0;
  box-shadow: inset -18px 0 30px rgba(94,63,47,.07);
}
.right-paper {
  border-radius: 2px 12px 12px 2px;
  box-shadow: inset 18px 0 30px rgba(94,63,47,.05);
}
.book-spine {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 26px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(76,51,40,.18), rgba(255,255,255,.55) 42%, rgba(76,51,40,.16));
  pointer-events: none;
}
.book-page-number {
  position: absolute;
  top: 22px;
  left: 28px;
  color: #b18f7f;
  font: 12px 'Playfair Display', serif;
}
.book-page-decoration {
  position: absolute;
  right: 34px;
  bottom: 25px;
  color: #bd9189;
  font-size: 25px;
}
.book-photo-frame {
  height: 100%;
  min-height: 360px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  align-content: center;
}
.book-photo-frame:empty:before {
  content: "A page waiting for your pictures";
  display: grid;
  place-items: center;
  min-height: 230px;
  border: 1px dashed #d9c4b9;
  color: #b59d91;
  font: italic 18px 'Playfair Display', serif;
  text-align: center;
  padding: 20px;
}
.book-photo-frame img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border: 8px solid #fffdf8;
  box-shadow: 0 12px 28px rgba(75,53,43,.16);
  transform: rotate(-1.2deg);
}
.book-photo-frame img:nth-child(2n) { transform: rotate(1.2deg); }
.right-paper.opened-page {
  border: 1px solid #e7d9c9;
  border-left: 0;
  margin: 0;
  padding: 52px 46px;
}
.right-paper .opened-content {
  max-height: 300px;
  overflow: auto;
}
.opened-audio {
  margin-top: 24px;
}
.opened-audio audio {
  width: 100%;
  max-width: 100%;
}
.book-page-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.book-page-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.book-page-nav span {
  min-width: 58px;
  text-align: center;
  color: #a28c82;
  font-size: 11px;
}
.book-page-nav button:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.real-book-reader.turn-next {
  animation: bookTurnNext .34s ease both;
}
.real-book-reader.turn-prev {
  animation: bookTurnPrev .34s ease both;
}
@keyframes bookTurnNext {
  0% { opacity: .7; transform: rotateY(-7deg) translateX(14px); }
  100% { opacity: 1; transform: rotateY(0) translateX(0); }
}
@keyframes bookTurnPrev {
  0% { opacity: .7; transform: rotateY(7deg) translateX(-14px); }
  100% { opacity: 1; transform: rotateY(0) translateX(0); }
}

@media (max-width: 768px) {
  .book-modal {
    width: 100%;
    max-height: 96vh;
    height: 96vh;
    padding: 24px 14px 20px;
    border-radius: 20px;
  }
  .real-book-reader {
    grid-template-columns: 1fr;
    min-height: 0;
    margin-top: 14px;
  }
  .book-spine { display: none; }
  .left-paper {
    min-height: 250px;
    border-right: 1px solid #e7d9c9;
    border-radius: 12px 12px 2px 2px;
  }
  .right-paper.opened-page {
    border-left: 1px solid #e7d9c9;
    border-radius: 2px 2px 12px 12px;
    padding: 28px 22px;
  }
  .book-photo-frame { min-height: 220px; }
  .book-photo-frame img { max-height: 220px; }
  .book-page-controls { flex-wrap: wrap; }
  .book-page-nav { order: 3; width: 100%; justify-content: center; }
  .book-media-picker { grid-template-columns: 1fr; }
}


/* v13 — native mobile file pickers + real book writing page */
.photo-upload, .settings-upload, .book-file-label, .media-add {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.book-file-label { display: inline-flex; align-items: center; justify-content: center; }
.book-writing-prompt {
  min-height: 310px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  background:
    repeating-linear-gradient(0deg, rgba(126,92,71,.025) 0, rgba(126,92,71,.025) 1px, transparent 1px, transparent 5px),
    #fffaf0;
  border: 1px solid #e7d9c9;
}
.book-writing-prompt h3 { font-family:'Playfair Display',serif; font-size:30px; font-weight:400; color:#5f4a43; margin:10px 0; }
.book-writing-prompt p { max-width:460px; color:#9c8980; font-size:12px; line-height:1.8; margin-bottom:20px; }
.book-prompt-flower { color:#bd9189; font-size:34px; }

/* Turn the memory editor into a real paper page rather than a generic form. */
#editorView {
  max-width: 900px;
  margin: 22px auto 0;
  padding: 42px 48px 52px;
  background:
    linear-gradient(90deg, rgba(117,82,61,.08), transparent 8%),
    repeating-linear-gradient(0deg, rgba(126,92,71,.025) 0, rgba(126,92,71,.025) 1px, transparent 1px, transparent 5px),
    #fffaf0;
  border: 1px solid #e7d9c9;
  box-shadow: inset 18px 0 30px rgba(94,63,47,.04), 0 20px 50px rgba(67,48,40,.10);
  position: relative;
}
#editorView:before {
  content:'OUR LITTLE BOOK';
  display:block; text-align:center; letter-spacing:3px; font-size:9px; color:#b18f7f; margin-bottom:20px;
}
#memoryForm input, #memoryForm textarea, #memoryForm select { background: rgba(255,253,248,.82); }
#memoryForm textarea { min-height: 240px; background: transparent; border: 0; border-bottom: 1px dashed #d9c4b9; padding: 14px 4px; }
#memoryForm textarea:focus { border-color:#bd9189; }
@media (max-width:768px) {
  #editorView { margin:14px 4px 0; padding:30px 22px 38px; border-radius:10px; }
  .book-writing-prompt { min-height:260px; padding:22px 16px; }
  .book-writing-prompt h3 { font-size:24px; }
}

/* =========================================================
   v14 — NATIVE FILE PICKER FIX
   The visible upload control owns the real <input type=file>.
   This avoids Android/WebView rejecting a programmatic .click().
   ========================================================= */
.file-picker-label {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}
.file-picker-label .native-file-input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  opacity: 0.001 !important;
  cursor: pointer !important;
  z-index: 10 !important;
  display: block !important;
  visibility: visible !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
}
.hero-photo,
.photo-placeholder,
.photo-upload,
.settings-upload,
.media-add,
.book-file-label {
  pointer-events: auto !important;
}

@media (max-width: 768px) {
  .file-picker-label .native-file-input {
    opacity: 0.001 !important;
  }
  .photo-upload,
  .settings-upload,
  .media-add,
  .book-file-label {
    min-height: 48px !important;
  }
}

/* =========================================================
   v15 — PREMIUM BOOK EXPERIENCE
   ========================================================= */
.book-modal {
  width: min(1240px, 96vw);
  max-height: 94vh;
  padding: 30px 34px 34px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.72), transparent 35%),
    linear-gradient(145deg, #f7eee5 0%, #efe2d5 100%);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 45px 120px rgba(35,24,20,.34), inset 0 1px 0 rgba(255,255,255,.8);
}
.book-modal-header { padding: 4px 64px 18px 6px; }
.book-modal-header h2 { font-size: clamp(38px, 5vw, 66px); line-height: .92; }
.book-modal-header p { max-width: 620px; }
.book-toolbar {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding: 12px;
  border:1px solid rgba(121,94,85,.14);
  border-radius:18px;
  background:rgba(255,252,248,.56);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65);
}
.book-toolbar .tab-button { border-radius:12px; }
.download-button.book-print-button { margin-left:auto; }

.book-cover-stage {
  min-height: 390px;
  margin: 18px 0 20px;
  display:grid;
  place-items:center;
  position:relative;
  overflow:hidden;
  border-radius:24px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.7), transparent 44%),
    linear-gradient(135deg, #ead8cd, #f7eee7 52%, #e7d1c5);
  border:1px solid rgba(121,94,85,.12);
}
.book-cover-stage:before,
.book-cover-stage:after { content:""; position:absolute; border-radius:50%; border:1px solid rgba(151,113,101,.15); }
.book-cover-stage:before { width:460px; height:460px; }
.book-cover-stage:after { width:330px; height:330px; }
.book-cover-real {
  width:min(300px, 58vw); aspect-ratio: .72;
  position:relative; z-index:2;
  padding:34px 26px;
  display:flex; flex-direction:column; align-items:center; justify-content:space-between;
  text-align:center;
  color:#f8eee6;
  border-radius:8px 15px 15px 8px;
  background:
    linear-gradient(90deg, rgba(45,28,23,.34), transparent 9%, transparent 90%, rgba(255,255,255,.07)),
    linear-gradient(145deg, #4b342d, #76554a 58%, #3d2a25);
  border:1px solid rgba(255,255,255,.18);
  box-shadow:-14px 18px 0 rgba(80,52,43,.13), 0 35px 70px rgba(62,42,36,.27), inset 12px 0 24px rgba(28,18,15,.16);
  transform:rotate(-2.4deg);
}
.book-cover-real:before { content:""; position:absolute; inset:14px; border:1px solid rgba(255,236,222,.28); border-radius:4px 10px 10px 4px; pointer-events:none; }
.cover-topline { letter-spacing:5px; font-size:8px; opacity:.82; }
.cover-emblem { width:52px; height:52px; border:1px solid rgba(255,235,220,.38); border-radius:50%; display:grid; place-items:center; font-size:24px; }
.book-cover-real h3 { font:400 clamp(30px,5vw,48px)/.88 'DM Serif Display','Playfair Display',serif; letter-spacing:-1px; margin:0; }
.book-cover-real h3 i { font-weight:400; }
.book-cover-real p { font:italic 11px/1.7 'Playfair Display',serif; opacity:.82; }
.cover-names { letter-spacing:4px; font-size:8px; opacity:.9; }
.cover-ribbon { position:absolute; top:0; bottom:0; right:34px; width:18px; background:linear-gradient(90deg, #bd9189, #d5a89f, #a9746d); opacity:.9; }
.cover-caption { position:absolute; bottom:20px; left:20px; right:20px; text-align:center; color:#9a8177; font-size:10px; letter-spacing:.3px; z-index:3; }

.entries-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:18px; }
.entries-list .entry-card {
  position:relative; overflow:hidden; min-height:250px;
  padding:26px 24px 22px;
  border:1px solid rgba(121,94,85,.16);
  border-radius:14px 14px 18px 10px;
  background:linear-gradient(145deg,#fffaf1,#f5e8db);
  box-shadow:0 18px 45px rgba(67,48,40,.10), inset 10px 0 20px rgba(115,78,58,.035);
  transform:rotate(var(--book-tilt, -0.4deg));
}
.entries-list .entry-card:nth-child(2n){ --book-tilt:.5deg; }
.entries-list .entry-card:before { content:""; position:absolute; left:0; top:0; bottom:0; width:5px; background:linear-gradient(#a8756d,#d4a79d); opacity:.75; }
.entries-list .entry-card:hover { transform:translateY(-5px) rotate(var(--book-tilt)); box-shadow:0 26px 55px rgba(67,48,40,.15); }
.entries-list .entry-card h3 { font-family:'DM Serif Display','Playfair Display',serif; font-size:28px; }
.entries-list .entry-card .entry-preview { color:#8f7b72; line-height:1.8; font-size:12px; }

/* Open book: richer paper, page edges and editorial layout. */
.real-book-reader {
  min-height: 590px;
  margin: 24px 0 18px;
  border-radius:16px;
  overflow:visible;
}
.real-book-reader:after {
  content:"";
  position:absolute; left:50%; top:5%; bottom:5%; width:70px; transform:translateX(-50%);
  background:radial-gradient(ellipse at center, rgba(55,36,28,.22), transparent 64%);
  filter:blur(7px); opacity:.55; pointer-events:none; z-index:3;
}
.book-paper {
  min-height:590px;
  background:
    linear-gradient(90deg, rgba(119,82,61,.13), transparent 9%, transparent 94%, rgba(119,82,61,.04)),
    repeating-linear-gradient(0deg, rgba(126,92,71,.026) 0, rgba(126,92,71,.026) 1px, transparent 1px, transparent 5px),
    #fffaf0;
  box-shadow:0 25px 55px rgba(67,48,40,.12);
}
.book-paper:after { content:""; position:absolute; inset:0; border-radius:inherit; box-shadow:inset 0 0 35px rgba(121,85,63,.05); pointer-events:none; }
.book-spine { width:42px; background:linear-gradient(90deg, rgba(76,51,40,.23), rgba(255,255,255,.75) 30%, rgba(76,51,40,.12) 52%, rgba(255,255,255,.58) 70%, rgba(76,51,40,.18)); }
.book-photo-frame { padding:32px 22px; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.book-photo-frame img { border:10px solid #fffdf8; box-shadow:0 16px 34px rgba(75,53,43,.18), 0 2px 0 rgba(75,53,43,.06); }
.book-photo-frame img:nth-child(3n) { transform:rotate(-2deg) translateY(6px); }
.book-photo-frame img:nth-child(4n) { transform:rotate(2.2deg) translateY(-4px); }
.right-paper.opened-page { padding:58px 58px 50px; }
.right-paper.opened-page h2 { font-family:'DM Serif Display','Playfair Display',serif; font-size:clamp(34px,4vw,58px); line-height:.95; color:#5a463f; margin:10px 0 12px; }
.opened-author { display:block; margin-bottom:28px; color:#b08f82; font-size:10px; letter-spacing:1px; text-transform:uppercase; }
.right-paper .opened-content { max-height:none; overflow:visible; white-space:pre-wrap; font:400 clamp(14px,1.4vw,17px)/2 'Playfair Display','Georgia',serif; color:#6c5750; }
.opened-audio { padding-top:22px; }
.opened-audio:before { content:"OUR SONG / VOICE"; display:block; letter-spacing:2px; font-size:8px; color:#b18f7f; margin-bottom:8px; }
.opened-audio audio { height:42px; }
.book-page-controls { padding:0 6px; }

/* Downloaded/printed book styling is generated by JS. */
@media (max-width:768px) {
  .book-modal { width:100%; max-height:96vh; height:96vh; padding:20px 12px 18px; border-radius:20px; }
  .book-modal-header { padding-right:48px; }
  .book-modal-header h2 { font-size:44px; }
  .book-toolbar { gap:7px; padding:8px; }
  .book-toolbar .tab-button, .book-toolbar .download-button { min-height:42px; padding:9px 11px; font-size:10px; }
  .download-button.book-print-button { margin-left:0; }
  .book-cover-stage { min-height:360px; }
  .book-cover-real { width:min(250px,62vw); }
  .real-book-reader { min-height:0; margin-top:12px; }
  .real-book-reader:after { display:none; }
  .book-paper { min-height:0; }
  .left-paper { min-height:330px; }
  .book-photo-frame { min-height:270px; padding:24px 12px; }
  .right-paper.opened-page { padding:36px 24px 42px; }
  .right-paper .opened-content { font-size:15px; line-height:1.9; }
  .book-page-controls { padding-bottom:4px; }
}

@media print {
  body * { visibility:hidden !important; }
  #bookPrintSurface, #bookPrintSurface * { visibility:visible !important; }
  #bookPrintSurface { position:absolute !important; inset:0 !important; background:#fff !important; }
}

/* v15 editor media previews */
.book-media-selection { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:10px; }
.book-media-chip.image-chip,
.book-media-chip.audio-chip {
  min-width:0; border-radius:16px; padding:8px; background:rgba(255,250,244,.82);
  border:1px solid #e3d1c5; box-shadow:0 8px 20px rgba(75,53,43,.07);
}
.book-media-chip.image-chip { display:grid; grid-template-columns:56px minmax(0,1fr) auto; align-items:center; gap:9px; }
.book-media-chip.image-chip img { width:56px; height:56px; object-fit:cover; border-radius:10px; border:2px solid #fff; box-shadow:0 4px 12px rgba(75,53,43,.13); }
.book-media-chip.audio-chip { display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:9px; }
.audio-icon { width:36px; height:36px; border-radius:50%; display:grid; place-items:center; background:linear-gradient(145deg,#76554a,#bd9189); color:#fff; font-size:18px; box-shadow:0 6px 14px rgba(95,67,57,.18); }
.audio-chip-body { min-width:0; display:grid; gap:5px; }
.audio-chip-body audio { width:100%; height:32px; }
.book-media-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#735d55; font-size:10px; }
.book-media-chip > button { width:28px; height:28px; border-radius:50%; background:#f2e4dc; border:1px solid #e1cdc2; display:grid; place-items:center; }

/* =========================================================
   THE HOME — BOOK VISUAL UPGRADE v16
   Visual-only upgrade: keeps the existing app structure,
   navigation, performance fixes and book functionality intact.
   ========================================================= */

:root{
  --book-ink:#4d3734;
  --book-muted:#92746c;
  --book-paper:#fbf1e4;
  --book-paper-2:#f5e5d4;
  --book-rose:#b96e78;
  --book-wine:#5a2638;
  --book-wine-2:#7b344d;
  --book-gold:#c89b5b;
  --book-gold-soft:#e5c897;
  --book-shadow:rgba(54,29,31,.25);
}

/* The modal itself becomes a premium reading room, without changing the
   surrounding The Home app. */
.book-modal{
  background:
    radial-gradient(circle at 12% 10%, rgba(255,255,255,.8), transparent 25%),
    radial-gradient(circle at 88% 18%, rgba(201,146,126,.18), transparent 28%),
    linear-gradient(135deg,#f7ece3 0%,#eee0d4 48%,#f8eee7 100%) !important;
  border:1px solid rgba(255,255,255,.82) !important;
  box-shadow:0 40px 120px rgba(45,25,28,.28), 0 10px 35px rgba(80,48,43,.12) !important;
  overflow:hidden !important;
}

.book-modal:before,
.book-modal:after{
  content:"";
  position:absolute;
  pointer-events:none;
  border-radius:50%;
  border:1px solid rgba(185,110,120,.14);
}
.book-modal:before{width:430px;height:430px;right:-180px;top:-170px;}
.book-modal:after{width:300px;height:300px;left:-160px;bottom:-150px;}

.book-modal-header{
  position:relative;
  z-index:2;
  padding-bottom:14px !important;
}
.book-modal-header .section-kicker{
  color:#a86f71 !important;
  letter-spacing:.28em !important;
}
.book-modal-header h2{
  color:#4e3634 !important;
  text-shadow:0 2px 0 rgba(255,255,255,.7);
}
.book-modal-header h2 i{
  color:#a85c68 !important;
}
.book-modal-header p{
  color:#896f69 !important;
}

.book-toolbar{
  position:relative;
  z-index:5;
  background:rgba(255,250,245,.62) !important;
  border:1px solid rgba(255,255,255,.8) !important;
  box-shadow:0 10px 30px rgba(80,48,43,.08);
  backdrop-filter:blur(12px);
  border-radius:18px !important;
}
.book-toolbar .tab-button,
.book-toolbar .download-button{
  border-color:rgba(145,91,88,.2) !important;
  background:rgba(255,255,255,.68) !important;
  color:#694c48 !important;
}
.book-toolbar .tab-button.active{
  background:linear-gradient(135deg,#7b344d,#a95869) !important;
  color:#fff !important;
  box-shadow:0 8px 22px rgba(123,52,77,.2);
}

/* Cover: richer leather, foil frame, stitched edge and decorative seal. */
.book-cover-stage{
  min-height:500px !important;
  isolation:isolate;
}
.book-cover-stage:before{
  width:520px !important;
  height:520px !important;
  border-color:rgba(185,110,120,.16) !important;
  box-shadow:0 0 80px rgba(185,110,120,.09);
}
.book-cover-stage:after{
  width:360px !important;
  height:360px !important;
  border-color:rgba(200,155,91,.14) !important;
}
.book-cover-real{
  width:min(350px,68vw) !important;
  min-height:430px !important;
  padding:48px 34px 38px !important;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,183,194,.12), transparent 24%),
    radial-gradient(circle at 72% 78%, rgba(226,188,103,.10), transparent 26%),
    linear-gradient(145deg,#4a1f30 0%,#67283f 48%,#421b2b 100%) !important;
  border:2px solid rgba(224,184,121,.7) !important;
  border-radius:9px 18px 18px 9px !important;
  box-shadow:
    18px 25px 45px rgba(50,23,30,.35),
    inset 0 0 0 8px rgba(53,19,30,.22),
    inset 0 0 0 10px rgba(229,200,151,.12),
    inset -18px 0 28px rgba(20,8,13,.2) !important;
  transform:perspective(1000px) rotateY(-4deg) rotateZ(-.5deg) !important;
}
.book-cover-real:before{
  inset:16px !important;
  border:1px solid rgba(239,207,153,.55) !important;
  border-radius:5px 12px 12px 5px !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);
}
.book-cover-real:after{
  content:"♥  ✦  ♥";
  position:absolute;
  top:27px;
  left:0;
  right:0;
  text-align:center;
  color:rgba(229,200,151,.72);
  font-size:11px;
  letter-spacing:8px;
}
.book-cover-real .cover-topline{
  color:#e9ca96 !important;
  letter-spacing:.34em !important;
  font-size:10px !important;
}
.book-cover-real .cover-emblem{
  width:58px;
  height:58px;
  margin:24px auto 22px !important;
  display:grid;
  place-items:center;
  border:1px solid rgba(231,199,145,.6);
  border-radius:50%;
  color:#e7c58e !important;
  background:rgba(255,255,255,.035);
  box-shadow:0 0 0 7px rgba(229,200,151,.05);
}
.book-cover-real h3{
  color:#f6e4ca !important;
  text-shadow:0 3px 12px rgba(0,0,0,.24);
}
.book-cover-real p{
  color:#d9bda4 !important;
  max-width:220px;
  margin:20px auto 28px !important;
}
.book-cover-real .cover-names{
  color:#e9ca96 !important;
  letter-spacing:.34em !important;
  border-top:1px solid rgba(229,200,151,.3);
  border-bottom:1px solid rgba(229,200,151,.3);
  padding:12px 0;
}
.book-cover-real .cover-ribbon{
  background:linear-gradient(180deg,#d58b94,#9b4d5c) !important;
  width:20px !important;
  height:105px !important;
  top:-1px !important;
  right:30px !important;
  box-shadow:0 7px 15px rgba(40,15,22,.25);
}
.cover-caption{
  color:#8f6d66 !important;
  font-size:11px !important;
  letter-spacing:.04em;
}

/* Entries become premium memory cards rather than plain blocks. */
.entries-list{
  gap:18px !important;
}
.entries-list .entry-card{
  background:
    linear-gradient(135deg,rgba(255,252,247,.95),rgba(246,232,220,.92)) !important;
  border:1px solid rgba(255,255,255,.92) !important;
  border-left:4px solid #b96e78 !important;
  border-radius:18px !important;
  box-shadow:0 18px 42px rgba(73,48,43,.12) !important;
  position:relative;
  overflow:hidden;
}
.entries-list .entry-card:after{
  content:"✦  MEMORY  ✦";
  position:absolute;
  right:18px;
  top:16px;
  color:#b28a82;
  font-size:8px;
  letter-spacing:.22em;
  opacity:.65;
}

/* The actual open book gets a stronger physical-book silhouette. */
.real-book-reader{
  background:
    linear-gradient(90deg,rgba(66,38,32,.13),transparent 7%,transparent 93%,rgba(66,38,32,.13)),
    #d8bca7 !important;
  border:1px solid rgba(100,62,50,.2) !important;
  border-radius:18px !important;
  padding:20px !important;
  gap:0 !important;
  box-shadow:
    0 35px 65px rgba(64,38,34,.25),
    0 8px 18px rgba(64,38,34,.13),
    inset 0 0 0 7px rgba(93,57,48,.08) !important;
}
.real-book-reader:before{
  content:"";
  position:absolute;
  inset:10px;
  border:1px solid rgba(255,244,232,.45);
  border-radius:12px;
  pointer-events:none;
  z-index:0;
}
.book-paper,
.opened-page{
  background:
    radial-gradient(circle at 15% 12%,rgba(184,125,92,.07),transparent 22%),
    radial-gradient(circle at 82% 75%,rgba(184,125,92,.055),transparent 20%),
    linear-gradient(90deg,#f7eadb,#fff8ee 48%,#f3e1cf) !important;
  border-color:rgba(118,79,62,.15) !important;
  box-shadow:inset 0 0 38px rgba(112,76,60,.07), 0 3px 12px rgba(70,43,36,.08) !important;
}
.book-paper:before,
.opened-page:before{
  content:"";
  position:absolute;
  inset:18px;
  border:1px solid rgba(169,119,100,.16);
  border-radius:3px;
  pointer-events:none;
}
.book-spine{
  width:50px !important;
  background:
    linear-gradient(90deg,rgba(66,38,32,.35),rgba(255,255,255,.72) 28%,rgba(112,74,58,.22) 48%,rgba(255,255,255,.72) 70%,rgba(66,38,32,.28)) !important;
  box-shadow:0 0 18px rgba(50,30,27,.18);
  z-index:2;
}

.book-page-number{
  color:#9a766a !important;
  font-family:'DM Serif Display','Playfair Display',serif !important;
  letter-spacing:.15em !important;
}
.book-page-decoration{
  color:#b96e78 !important;
  text-shadow:0 2px 8px rgba(185,110,120,.15);
}
.book-photo-frame{
  padding:30px 24px !important;
  gap:20px !important;
}
.book-photo-frame img{
  border:9px solid #fffaf4 !important;
  border-bottom-width:24px !important;
  border-radius:2px !important;
  box-shadow:0 16px 28px rgba(69,44,38,.2), 0 2px 4px rgba(69,44,38,.1) !important;
  filter:saturate(.94) contrast(1.02);
}
.book-photo-frame img:nth-child(3n){transform:rotate(-3deg) translateY(7px) !important;}
.book-photo-frame img:nth-child(4n){transform:rotate(2.5deg) translateY(-5px) !important;}
.book-photo-frame img:nth-child(5n){transform:rotate(-1deg) translateY(2px) !important;}

.opened-page .section-kicker{
  color:#a46f69 !important;
  letter-spacing:.24em !important;
}
.opened-page h2{
  color:#533b37 !important;
  font-family:'DM Serif Display','Playfair Display',serif !important;
  font-weight:400 !important;
}
.opened-author{
  color:#9d7b70 !important;
  border-bottom:1px dashed rgba(169,119,100,.35);
  padding-bottom:10px;
}
.opened-content{
  color:#5f4a44 !important;
  font-family:'DM Serif Display','Playfair Display',serif !important;
  font-size:17px !important;
  line-height:1.95 !important;
  letter-spacing:.01em;
}
.opened-footer{
  color:#b47b78 !important;
  font-family:'Playfair Display',serif !important;
  font-style:italic;
}

/* Audio becomes a little “record player” panel. */
.opened-audio{
  background:linear-gradient(135deg,rgba(92,43,58,.96),rgba(132,70,80,.96)) !important;
  color:#fff4e8 !important;
  border:1px solid rgba(229,200,151,.35) !important;
  border-radius:18px !important;
  box-shadow:0 15px 30px rgba(74,37,45,.2) !important;
  position:relative;
  overflow:hidden;
}
.opened-audio:before{
  content:"♫  OUR SONG";
  display:block;
  color:#e8c896;
  font-size:9px;
  letter-spacing:.24em;
  margin-bottom:7px;
}

/* Controls feel like book controls, not generic web buttons. */
.book-page-controls{
  position:relative;
  z-index:4;
}
.book-page-controls .outline-account,
.book-page-controls .back-button,
.book-page-controls .delete-button{
  border-radius:999px !important;
  border:1px solid rgba(159,102,100,.28) !important;
  background:rgba(255,250,245,.84) !important;
  color:#704f4a !important;
  box-shadow:0 8px 20px rgba(75,47,43,.08);
}
.book-page-nav span{
  background:linear-gradient(135deg,#6c3047,#a85c68) !important;
  color:#fff !important;
  border-radius:999px !important;
  padding:9px 16px !important;
  box-shadow:0 8px 20px rgba(108,48,71,.18);
}

/* Editor looks like writing on a keepsake page. */
#memoryForm{
  background:
    linear-gradient(90deg,rgba(117,76,58,.045) 1px,transparent 1px),
    linear-gradient(rgba(117,76,58,.045) 1px,transparent 1px),
    linear-gradient(135deg,#fff9f0,#f5e7d8) !important;
  background-size:28px 28px,28px 28px,100% 100% !important;
  border:1px solid rgba(145,102,83,.14) !important;
  box-shadow:0 25px 55px rgba(67,45,39,.14) !important;
}
#memoryForm input,
#memoryForm textarea,
#memoryForm select{
  color:#5a4540 !important;
  border-color:rgba(145,102,83,.2) !important;
}
#memoryForm textarea{
  background:repeating-linear-gradient(to bottom,transparent 0,transparent 31px,rgba(151,111,96,.14) 32px) !important;
  line-height:32px !important;
  min-height:280px !important;
}

/* Mobile: preserve the same premium identity without making the book tiny. */
@media(max-width:768px){
  .book-modal{
    padding:14px 10px 14px !important;
    border-radius:18px !important;
  }
  .book-cover-stage{min-height:420px !important;}
  .book-cover-real{
    width:min(300px,76vw) !important;
    min-height:380px !important;
    padding:40px 26px 32px !important;
  }
  .real-book-reader{
    padding:10px !important;
    border-radius:14px !important;
  }
  .book-spine{display:none !important;}
  .book-paper,.opened-page{
    min-height:420px !important;
  }
  .book-photo-frame{
    min-height:245px !important;
    padding:22px 12px !important;
    gap:12px !important;
  }
  .book-photo-frame img{
    border-width:7px !important;
    border-bottom-width:18px !important;
  }
  .opened-content{
    font-size:15px !important;
    line-height:1.85 !important;
  }
  .book-toolbar{backdrop-filter:none !important;}
}

/* =========================================================
   v17 — FINAL MOBILE BOOK PERFORMANCE + REAL FILE INPUT
   ========================================================= */

/* The native file control itself is interactive. This avoids relying on
   programmatic input.click() and avoids nested label/input tap issues. */
.photo-upload-wrap {
  margin-top: 12px;
  width: min(300px, 100%);
  position: relative;
  z-index: 50;
}
.photo-file-input {
  display: block !important;
  width: 100% !important;
  min-height: 52px !important;
  box-sizing: border-box !important;
  padding: 13px 16px !important;
  border: 1px solid #d9c4b9 !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,.96) !important;
  color: #795e55 !important;
  font: 500 14px/1.2 'DM Sans', sans-serif !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}
.photo-file-input::file-selector-button {
  border: 0 !important;
  border-radius: 10px !important;
  padding: 9px 13px !important;
  margin-right: 10px !important;
  background: #f1e4dc !important;
  color: #6f514a !important;
  font: 600 13px 'DM Sans', sans-serif !important;
  cursor: pointer !important;
}
.photo-file-input:active { transform: scale(.985); }

/* Remove the most expensive effects from the book on phones. */
@media (max-width: 768px) {
  .modal-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .book-modal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 18px 45px rgba(45,25,28,.22) !important;
    animation: none !important;
  }
  .book-modal:before,
  .book-modal:after,
  .real-book-reader:after,
  .book-paper:after,
  .opened-page:after {
    display: none !important;
  }
  .real-book-reader {
    filter: none !important;
    perspective: none !important;
    box-shadow: 0 18px 38px rgba(64,38,34,.18) !important;
  }
  .book-paper,
  .opened-page,
  .book-cover-real {
    box-shadow: inset 0 0 22px rgba(112,76,60,.055) !important;
  }
  .book-page-controls,
  .book-toolbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* =========================================================
   v18 — BOOK SCROLL / MOBILE INTERACTION FIX
   The v16 visual upgrade accidentally used overflow:hidden on the
   book modal, which clipped the book and made the mobile reader feel
   completely frozen. This final layer restores a real scroll surface
   without changing the visual design.
   ========================================================= */
.book-modal {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain;
  touch-action: pan-y !important;
}

.real-book-reader {
  touch-action: pan-y !important;
  transform: none;
}

@media (max-width: 768px) {
  .modal-overlay {
    overflow: hidden !important;
    align-items: flex-start !important;
    padding: 8px !important;
  }

  .book-modal {
    width: 100% !important;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior: contain;
    padding-bottom: 28px !important;
  }

  .book-modal-header,
  .book-toolbar,
  .real-book-reader,
  .book-page-controls {
    flex-shrink: 0;
  }

  /* One continuous vertical reading surface on phones. */
  .real-book-reader {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 14px 0 18px !important;
    padding: 10px !important;
    overflow: visible !important;
    perspective: none !important;
    filter: none !important;
    transform: none !important;
  }

  .real-book-reader .book-paper,
  .real-book-reader .opened-page {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 440px !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
  }

  .real-book-reader .left-paper {
    border-right: 1px solid rgba(118,79,62,.15) !important;
    border-radius: 12px 12px 3px 3px !important;
  }

  .real-book-reader .right-paper.opened-page {
    border-left: 1px solid rgba(118,79,62,.15) !important;
    border-radius: 3px 3px 12px 12px !important;
    padding: 34px 22px 46px !important;
  }

  .real-book-reader .book-photo-frame {
    min-height: 300px !important;
    height: auto !important;
    align-content: start !important;
  }

  .real-book-reader .book-photo-frame:empty:before {
    min-height: 250px !important;
  }

  .real-book-reader .book-photo-frame img {
    max-height: 300px !important;
    height: auto !important;
  }

  .real-book-reader .opened-content {
    max-height: none !important;
    overflow: visible !important;
    white-space: pre-wrap !important;
  }

  .book-page-controls {
    position: relative !important;
    z-index: 20 !important;
    margin-bottom: 8px !important;
  }

  /* Disable the page-turn transform on touch devices; it can create a
     compositor layer that fights scrolling on lower-end phones. */
  .real-book-reader.turn-next,
  .real-book-reader.turn-prev {
    animation: none !important;
  }
}

/* =========================================================
   v19 — LUXURY MEMORY SCRAPBOOK
   Visual-only refinement of Our Little Book.
   The rest of The Home remains untouched.
   ========================================================= */
.book-modal {
  background:
    radial-gradient(circle at 15% 5%, rgba(255,255,255,.78), transparent 32%),
    linear-gradient(145deg, #f5e9df 0%, #ead8cd 52%, #f7eee7 100%) !important;
  border: 1px solid rgba(255,255,255,.82) !important;
  box-shadow: 0 42px 120px rgba(48,29,26,.34), inset 0 1px 0 rgba(255,255,255,.85) !important;
}

.book-modal-header {
  position: relative;
  padding: 10px 72px 18px 12px !important;
}
.book-modal-header:after {
  content: "✦  OUR STORY  ✦";
  display: block;
  width: fit-content;
  margin-top: 14px;
  padding: 6px 12px;
  border-top: 1px solid rgba(151,106,91,.24);
  border-bottom: 1px solid rgba(151,106,91,.24);
  color: #a37c70;
  font-size: 8px;
  letter-spacing: .28em;
}

.book-toolbar {
  border: 1px solid rgba(121,94,85,.16) !important;
  background: rgba(255,250,245,.64) !important;
  box-shadow: 0 10px 28px rgba(79,49,43,.06), inset 0 1px 0 rgba(255,255,255,.8) !important;
}
.book-toolbar .tab-button.active {
  background: #5d3d39 !important;
  color: #fff8f2 !important;
  box-shadow: 0 8px 20px rgba(72,42,38,.18);
}

.book-cover-stage {
  min-height: 470px !important;
  margin: 22px 0 26px !important;
  background:
    radial-gradient(circle at 50% 48%, rgba(255,255,255,.72), transparent 38%),
    repeating-linear-gradient(0deg, rgba(116,82,64,.025) 0, rgba(116,82,64,.025) 1px, transparent 1px, transparent 5px),
    linear-gradient(135deg, #e6cec0, #f7eee8 54%, #dfc5b8) !important;
  border: 1px solid rgba(121,94,85,.13) !important;
}
.book-cover-stage:before { width: 520px !important; height: 520px !important; border-color: rgba(151,113,101,.13) !important; }
.book-cover-stage:after { width: 380px !important; height: 380px !important; border-color: rgba(151,113,101,.12) !important; }

.book-cover-real {
  width: min(330px, 62vw) !important;
  padding: 42px 30px !important;
  border-radius: 7px 18px 18px 7px !important;
  background:
    linear-gradient(90deg, rgba(37,20,23,.38), transparent 10%, transparent 89%, rgba(255,255,255,.06)),
    radial-gradient(circle at 70% 25%, rgba(150,82,91,.28), transparent 32%),
    linear-gradient(145deg, #4d3033 0%, #6b4147 56%, #392327 100%) !important;
  border: 1px solid rgba(255,236,222,.2) !important;
  box-shadow:
    -16px 20px 0 rgba(78,48,43,.12),
    0 40px 78px rgba(61,38,35,.31),
    inset 14px 0 28px rgba(27,15,17,.18) !important;
  transform: rotate(-2deg) !important;
}
.book-cover-real:before {
  inset: 17px !important;
  border: 1px solid rgba(242,207,171,.34) !important;
  border-radius: 5px 12px 12px 5px !important;
}
.book-cover-real:after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(242,207,171,.12);
  border-radius: 3px 9px 9px 3px;
  pointer-events: none;
}
.cover-topline {
  color: #e9ca96 !important;
  letter-spacing: .42em !important;
  font-size: 8px !important;
}
.cover-emblem {
  width: 64px !important;
  height: 64px !important;
  border-color: rgba(233,202,150,.48) !important;
  color: #f0d8b0 !important;
  box-shadow: 0 0 0 7px rgba(233,202,150,.035);
}
.book-cover-real h3 {
  font-size: clamp(34px, 5vw, 54px) !important;
  text-shadow: 0 3px 18px rgba(20,8,10,.22);
}
.book-cover-real p { color: #f1ddd0 !important; opacity: .86 !important; }
.cover-names { color: #e9ca96 !important; letter-spacing: .36em !important; }
.cover-ribbon {
  right: 32px !important;
  width: 21px !important;
  background: linear-gradient(180deg,#d68d98,#a84e61) !important;
  box-shadow: 0 8px 16px rgba(40,15,22,.25) !important;
}
.cover-caption {
  color: #8f6d66 !important;
  font-size: 10px !important;
  letter-spacing: .08em !important;
}

.empty-book {
  margin: 10px 0 24px;
  padding: 44px 26px !important;
  border: 1px dashed rgba(158,119,106,.34) !important;
  border-radius: 16px !important;
  background: rgba(255,249,243,.48) !important;
}
.empty-book > span { color: #b47c83 !important; }
.empty-book h3 { font-family: 'DM Serif Display','Playfair Display',serif !important; font-size: 32px !important; }

.entries-list {
  grid-template-columns: repeat(auto-fill, minmax(270px,1fr)) !important;
  gap: 22px !important;
  padding: 2px 2px 16px;
}
.entries-list .entry-card {
  min-height: 280px !important;
  padding: 30px 28px 26px !important;
  border: 1px solid rgba(255,255,255,.95) !important;
  border-left: 0 !important;
  border-radius: 5px 16px 14px 5px !important;
  background:
    repeating-linear-gradient(0deg, rgba(126,92,71,.022) 0, rgba(126,92,71,.022) 1px, transparent 1px, transparent 5px),
    linear-gradient(145deg,#fffaf2,#f2e4d8) !important;
  box-shadow: 0 20px 46px rgba(67,48,40,.12), inset 8px 0 20px rgba(115,78,58,.035) !important;
}
.entries-list .entry-card:before {
  width: 4px !important;
  background: linear-gradient(#a34e5d,#d7a29c) !important;
}
.entries-list .entry-card:after {
  content: "MEMORY  •  THE HOME" !important;
  top: 19px !important;
  right: 20px !important;
  letter-spacing: .18em !important;
}
.entries-list .entry-card small {
  display: inline-block;
  margin-bottom: 22px;
  color: #a87f74 !important;
  letter-spacing: .16em;
  font-size: 9px;
  text-transform: uppercase;
}
.entries-list .entry-card h3 {
  font-size: 30px !important;
  line-height: 1 !important;
  color: #5d4741 !important;
  max-width: 88%;
}
.entries-list .entry-card p {
  color: #826d64 !important;
  line-height: 1.85 !important;
  margin-top: 14px;
}
.entries-list .entry-card .entry-author {
  display: inline-block;
  margin-top: 20px;
  padding-top: 11px;
  border-top: 1px dashed #d8c0b5;
  color: #aa877c !important;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.real-book-reader {
  min-height: 610px !important;
  padding: 22px !important;
  background:
    linear-gradient(90deg, rgba(54,29,25,.16), transparent 8%, transparent 92%, rgba(54,29,25,.14)),
    linear-gradient(145deg,#d2ad98,#e2c7b6 50%,#cba38f) !important;
  border: 1px solid rgba(96,58,47,.22) !important;
  border-radius: 20px !important;
  box-shadow: 0 38px 72px rgba(64,38,34,.25), inset 0 1px 0 rgba(255,255,255,.28) !important;
}
.book-paper {
  min-height: 566px !important;
  background:
    linear-gradient(90deg, rgba(119,82,61,.14), transparent 10%, transparent 92%, rgba(119,82,61,.045)),
    repeating-linear-gradient(0deg, rgba(126,92,71,.025) 0, rgba(126,92,71,.025) 1px, transparent 1px, transparent 5px),
    #fffaf0 !important;
  border-color: #e3d2c2 !important;
}
.left-paper { box-shadow: inset -22px 0 32px rgba(94,63,47,.07), 0 18px 34px rgba(67,48,40,.08) !important; }
.right-paper { box-shadow: inset 22px 0 32px rgba(94,63,47,.055), 0 18px 34px rgba(67,48,40,.08) !important; }
.book-spine {
  width: 48px !important;
  background: linear-gradient(90deg,rgba(76,51,40,.26),rgba(255,255,255,.78) 30%,rgba(76,51,40,.11) 52%,rgba(255,255,255,.62) 70%,rgba(76,51,40,.2)) !important;
}
.book-page-number { color:#b08b7d !important; letter-spacing:.08em; }
.book-page-decoration { color:#b06e78 !important; }
.book-photo-frame { padding: 34px 24px !important; gap: 18px !important; }
.book-photo-frame img {
  border: 11px solid #fffdf8 !important;
  padding: 0 !important;
  box-shadow: 0 18px 36px rgba(75,53,43,.19), 0 2px 0 rgba(75,53,43,.06) !important;
}
.right-paper.opened-page {
  padding: 62px 62px 54px !important;
}
.right-paper.opened-page:before {
  content: "CHAPTER • A MOMENT TO KEEP";
  display: block;
  color: #b08b7d;
  font-size: 8px;
  letter-spacing: .23em;
  border-bottom: 1px solid #e4d4c7;
  padding-bottom: 12px;
  margin-bottom: 22px;
}
.right-paper.opened-page h2 {
  font-size: clamp(36px,4vw,62px) !important;
  color:#5a403c !important;
  margin: 8px 0 14px !important;
}
.opened-author { color:#a87870 !important; letter-spacing:.14em !important; }
.right-paper .opened-content {
  font-size: clamp(14px,1.4vw,18px) !important;
  line-height: 2.05 !important;
  color:#6c5750 !important;
}
.opened-audio {
  margin-top: 30px !important;
  padding: 17px 18px 12px !important;
  border: 1px solid #ead9ce;
  border-radius: 12px;
  background: rgba(248,238,231,.55);
}
.opened-audio:before { color:#a87870 !important; }
.opened-audio audio { height:40px !important; }
.opened-footer { color:#b08f82 !important; }

#editorView {
  border-radius: 10px !important;
  background:
    linear-gradient(90deg, rgba(117,82,61,.09), transparent 9%),
    repeating-linear-gradient(0deg, rgba(126,92,71,.025) 0, rgba(126,92,71,.025) 1px, transparent 1px, transparent 5px),
    #fffaf0 !important;
  box-shadow: 0 24px 60px rgba(67,48,40,.13), inset 18px 0 30px rgba(94,63,47,.04) !important;
}
#editorView:after {
  content: "✿";
  position: absolute;
  right: 32px;
  bottom: 24px;
  color: #b06e78;
  font-size: 22px;
}
#memoryForm label { color:#8d7168 !important; letter-spacing:.02em; }
#memoryForm input, #memoryForm select {
  border-color:#e2d1c5 !important;
  border-radius:10px !important;
}
#memoryForm textarea {
  color:#654f49 !important;
  font: 400 17px/2 'Playfair Display','Georgia',serif !important;
}
.book-media-pick .outline-account { border-color:#d8c0b5 !important; background:rgba(255,250,245,.72) !important; }

@media (max-width: 768px) {
  .book-modal { padding: 22px 12px 28px !important; }
  .book-modal-header { padding: 8px 52px 16px 4px !important; }
  .book-modal-header h2 { font-size: 42px !important; }
  .book-modal-header:after { font-size:7px; letter-spacing:.18em; }
  .book-cover-stage { min-height: 420px !important; }
  .book-cover-real { width:min(290px,72vw) !important; }
  .entries-list { grid-template-columns:1fr !important; }
  .entries-list .entry-card { min-height:245px !important; }
  .real-book-reader { padding: 12px !important; border-radius:16px !important; }
  .real-book-reader .book-paper,
  .real-book-reader .opened-page { min-height: 0 !important; }
  .real-book-reader .left-paper { min-height: 360px !important; }
  .real-book-reader .right-paper.opened-page { padding: 38px 24px 46px !important; }
  .right-paper.opened-page:before { margin-bottom:18px; }
  .right-paper.opened-page h2 { font-size:42px !important; }
  .right-paper .opened-content { font-size:16px !important; line-height:2 !important; }
  .book-photo-frame { padding:24px 12px !important; }
}

/* HOME DASHBOARD — layout only; keeps the existing The Home visual language */
.home-dashboard{padding:8px 0 42px}
.dashboard-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:18px}
.dashboard-heading h2{font-family:'Playfair Display',serif;font-size:clamp(25px,3vw,34px);font-weight:400;margin-top:9px}
.dashboard-heading h2 i{color:var(--rose);font-weight:400}
.dashboard-note{color:var(--muted);font-size:10px;letter-spacing:.5px;padding-bottom:4px}
.dashboard-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.dashboard-card{min-width:0;min-height:108px;display:grid;grid-template-columns:40px minmax(0,1fr) 18px;align-items:center;gap:12px;padding:18px 15px;text-align:left;color:var(--brown);background:#eee5dc;border:1px solid rgba(112,82,67,.08);border-radius:5px;cursor:pointer;transition:transform .2s ease,background .2s ease,border-color .2s ease}
.dashboard-card:hover{transform:translateY(-2px);background:#e9ddd3;border-color:rgba(189,145,137,.35)}
.dashboard-card:focus-visible{outline:2px solid var(--rose);outline-offset:3px}
.dashboard-icon{width:40px;height:40px;display:grid;place-items:center;border:1px solid rgba(189,145,137,.48);border-radius:50%;color:var(--rose);font-size:18px;background:rgba(255,250,245,.5)}
.dashboard-copy{min-width:0;display:flex;flex-direction:column;gap:5px}
.dashboard-copy strong{font-family:'Playfair Display',serif;font-size:16px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-copy small{color:var(--muted);font-size:9px;line-height:1.5}
.dashboard-arrow{color:var(--rose);font-size:15px;text-align:right}
@media (max-width:1050px){.dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:768px){.home-dashboard{padding:4px 0 30px}.dashboard-heading{align-items:flex-start;flex-direction:column;gap:6px;margin-bottom:14px}.dashboard-heading h2{font-size:27px}.dashboard-note{padding-bottom:0}.dashboard-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.dashboard-card{min-height:96px;grid-template-columns:34px minmax(0,1fr) 14px;gap:9px;padding:14px 11px}.dashboard-icon{width:34px;height:34px;font-size:16px}.dashboard-copy strong{font-size:14px}.dashboard-copy small{font-size:8px}}
@media (max-width:430px){.dashboard-grid{grid-template-columns:1fr}.dashboard-card{min-height:82px}}

/* ===== THE HOME WOW FINAL · MOBILE ROMANTIC WORLD ===== */
:root{--wow-rose:#9d5366;--wow-rose2:#d28c99;--wow-ink:#49343b;--wow-paper:#fffaf7}
.love-world{position:absolute;inset:-26px -16px 0;pointer-events:none;z-index:4;overflow:visible}
.love-moon{position:absolute;right:12%;top:5%;font-size:52px;color:#b88791;opacity:.72;animation:wowMoon 7s ease-in-out infinite}
.love-stars{position:absolute;left:8%;top:10%;letter-spacing:18px;color:#d7a0a9;font-size:16px;animation:wowTwinkle 3.5s ease-in-out infinite}
.love-couple-svg{position:absolute;left:50%;bottom:10px;width:min(94%,430px);transform:translateX(-50%);filter:drop-shadow(0 18px 22px rgba(90,54,61,.12));animation:wowBreath 4.8s ease-in-out infinite}
.love-couple-svg svg{width:100%;display:block}
.person-left{animation:wowSwayL 4.6s ease-in-out infinite;transform-origin:158px 210px}
.person-right{animation:wowSwayR 4.6s ease-in-out infinite;transform-origin:260px 210px}
.hug-arm{animation:wowHug 3.2s ease-in-out infinite;transform-origin:210px 155px}
.heart-core{transform-origin:209px 156px;animation:wowHeart 1.7s ease-in-out infinite}
.mini-love{position:absolute;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:rgba(255,250,247,.88);box-shadow:0 10px 24px rgba(91,57,65,.12);border:1px solid rgba(157,83,102,.12);font-size:17px;animation:wowFloat 4.8s ease-in-out infinite;will-change:transform}
.mini-home{left:4%;bottom:25%;animation-delay:-.5s}.mini-heart{right:7%;bottom:31%;animation-delay:-1.2s}.mini-hug{left:11%;top:37%;animation-delay:-2s}.mini-ring{right:15%;top:28%;animation-delay:-2.7s}.mini-rose{left:27%;top:8%;animation-delay:-1.6s}.mini-letter{right:28%;top:4%;animation-delay:-3.2s}.mini-gift{right:2%;bottom:12%;animation-delay:-.9s}.mini-star{left:39%;top:18%;animation-delay:-2.4s;background:transparent;box-shadow:none;border:0}
.love-letter-strip{position:relative;margin:8px 0 26px;padding:30px 28px;border:1px solid rgba(157,83,102,.16);border-radius:30px;background:linear-gradient(135deg,rgba(255,250,247,.95),rgba(246,231,226,.68));box-shadow:0 20px 60px rgba(80,50,56,.07);overflow:hidden}
.love-letter-strip:before{content:'♡';position:absolute;right:20px;top:-25px;font-size:130px;color:rgba(157,83,102,.08);font-family:serif}
.love-letter-head{position:relative;z-index:2;max-width:760px}.love-letter-head h2{margin:7px 0 9px;color:var(--wow-ink);font-size:clamp(28px,5vw,46px);line-height:1.15}.love-letter-head h2 i{color:var(--wow-rose);font-family:Georgia,serif}.love-letter-head p{margin:0;color:#735f64;line-height:1.9;font-size:15px}
.love-pills{position:relative;z-index:2;display:flex;flex-wrap:wrap;gap:9px;margin-top:20px}.love-pills span{padding:10px 14px;border-radius:999px;background:rgba(255,255,255,.72);border:1px solid rgba(157,83,102,.12);color:#6b4e57;font-size:12px;box-shadow:0 8px 18px rgba(80,50,56,.05);animation:pillFloat 5s ease-in-out infinite}.love-pills span:nth-child(2){animation-delay:-1s}.love-pills span:nth-child(3){animation-delay:-2s}.love-pills span:nth-child(4){animation-delay:-3s}
@keyframes wowBreath{0%,100%{transform:translateX(-50%) translateY(0)}50%{transform:translateX(-50%) translateY(-7px)}}
@keyframes wowSwayL{0%,100%{transform:rotate(-1deg)}50%{transform:rotate(2deg)}}
@keyframes wowSwayR{0%,100%{transform:rotate(1deg)}50%{transform:rotate(-2deg)}}
@keyframes wowHug{0%,100%{stroke-width:13}50%{stroke-width:15}}
@keyframes wowHeart{0%,100%{transform:scale(.94)}50%{transform:scale(1.16)}}
@keyframes wowFloat{0%,100%{transform:translate3d(0,0,0) rotate(-3deg)}50%{transform:translate3d(0,-13px,0) rotate(4deg)}}
@keyframes wowMoon{0%,100%{transform:translateY(0) rotate(-4deg)}50%{transform:translateY(-9px) rotate(4deg)}}
@keyframes wowTwinkle{0%,100%{opacity:.35;transform:scale(.95)}50%{opacity:1;transform:scale(1.08)}}
@keyframes pillFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@media(max-width:700px){
 .hero-section{padding-top:30px!important;gap:8px!important}
 .hero-copy{text-align:center}.hero-copy .section-kicker{display:inline-block}.hero-copy h1{font-size:clamp(38px,12vw,54px)!important;line-height:1.12}.hero-copy>p{font-size:14px;line-height:1.85;max-width:330px;margin:14px auto}.hero-signature{justify-content:center}
 .hero-visual{min-height:450px!important;margin-top:0}.love-world{inset:-10px -10px 0}.love-couple-svg{width:96%;bottom:8px}.mini-love{width:31px;height:31px;font-size:15px}.mini-home{left:1%;bottom:23%}.mini-heart{right:1%;bottom:29%}.mini-hug{left:2%;top:40%}.mini-ring{right:7%;top:26%}.mini-rose{left:20%;top:7%}.mini-letter{right:20%;top:3%}.mini-gift{right:0;bottom:12%}
 .love-letter-strip{margin:0 0 20px;padding:24px 19px;border-radius:25px}.love-letter-head h2{font-size:29px}.love-letter-head p{font-size:13px;line-height:1.9}.love-pills{gap:7px}.love-pills span{font-size:11px;padding:9px 11px}
}
@media(prefers-reduced-motion:reduce){.love-world *,.love-pills span{animation:none!important}}

.cloud-sync-badge{position:fixed;left:50%;bottom:94px;transform:translate(-50%,20px);opacity:0;pointer-events:none;z-index:9999;padding:10px 15px;border-radius:999px;background:rgba(65,45,50,.92);color:#fff;font-size:12px;transition:.3s}.cloud-sync-badge.show{opacity:1;transform:translate(-50%,0)}


/* ================================================================
   THE HOME — FINAL MOBILE POLISH v28
   Clean photo, better Arabic typography, distributed love objects.
   ================================================================ */
:root{
  --arabic-font:'Tajawal',Tahoma,Arial,sans-serif;
  --app-font:'DM Sans',sans-serif;
  --love-ink:#4b383d;
  --love-rose:#a75d6d;
  --love-soft:#f5e7e4;
}

/* Keep the photo itself clean. No text sits on top of the actual memory. */
.hero-photo{position:relative!important;overflow:hidden!important;height:auto!important;min-height:0!important;padding:10px!important;border-radius:30px!important;transform:none!important;animation:none!important;background:rgba(255,255,255,.62)!important}
.hero-photo img{display:block!important;width:100%!important;height:auto!important;aspect-ratio:4/3!important;object-fit:cover!important;border-radius:22px!important}
.hero-photo.has-photo img{display:block!important}
.photo-caption{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;opacity:1!important;color:var(--love-ink)!important;text-shadow:none!important;background:linear-gradient(180deg,rgba(255,250,247,.96),rgba(248,235,232,.78))!important;border:1px solid rgba(167,93,109,.13)!important;border-radius:20px!important;padding:16px 17px 15px!important;margin:12px 3px 0!important;display:block!important}
.photo-caption span{display:block!important;font-size:11px!important;letter-spacing:.4px!important;color:#a46c75!important;font-weight:700!important}
.photo-caption p{font-family:'Tajawal','Cairo',sans-serif!important;font-style:normal!important;font-size:18px!important;line-height:1.75!important;margin:5px 0 0!important;color:#4f3c40!important;font-weight:600!important}
.hero-photo:before{display:none!important}

/* Arabic typography: cleaner, softer and more premium. */
html[dir="rtl"] body,html[dir="rtl"] button,html[dir="rtl"] input,html[dir="rtl"] textarea,html[dir="rtl"] select,
html[dir="rtl"] body *{font-family:var(--arabic-font)!important}
html[dir="rtl"] .hero-copy h1,
html[dir="rtl"] .section-heading h2,
html[dir="rtl"] .book-preview h2,
html[dir="rtl"] .simple-section h2,
html[dir="rtl"] .dashboard-heading h2,
html[dir="rtl"] .love-letter-head h2{font-family:'Noto Kufi Arabic','Tajawal',sans-serif!important;font-weight:600!important;letter-spacing:-.6px!important}
.hero-copy h1{font-weight:500!important}
.hero-copy h1 i{font-family:'Tajawal',sans-serif!important;font-weight:700!important}
.hero-copy>p{color:#7e6b68!important}
.hero-signature{font-family:'Tajawal',sans-serif!important;font-weight:600!important;font-style:normal!important;transform:none!important;color:#9c626c!important}

/* Hero layout: text → button → signature → photo → caption → counter. */
.hero-section{align-items:start!important}
.hero-copy{display:flex!important;flex-direction:column!important;align-items:flex-start!important}
.hero-visual{display:flex!important;flex-direction:column!important;position:relative!important;min-height:0!important}
.together-counter{position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;margin:14px 4px 0!important;width:calc(100% - 8px)!important;max-width:none!important}

/* Decorative world stays around the photo, never over it. */
.love-world{inset:auto 0 auto 0!important;top:0!important;height:330px!important;z-index:5!important;overflow:visible!important}
.love-couple-svg{width:min(30%,170px)!important;right:-10px!important;left:auto!important;bottom:4px!important;opacity:.9!important;transform:none!important}
.love-couple-svg svg{filter:drop-shadow(0 10px 16px rgba(90,54,61,.10))}
.mini-love{width:34px!important;height:34px!important;font-size:16px!important;z-index:6!important}
.mini-home{left:-8px!important;bottom:24%!important}.mini-heart{right:-8px!important;bottom:42%!important}.mini-hug{left:-4px!important;top:37%!important}.mini-ring{right:7%!important;top:3%!important}.mini-rose{left:20%!important;top:-4%!important}.mini-letter{right:30%!important;top:-7%!important}.mini-gift{right:-7px!important;bottom:13%!important}.mini-star{left:42%!important;top:12%!important}
.love-moon{right:2%!important;top:2px!important;font-size:42px!important}
.love-stars{left:2%!important;top:2%!important;font-size:13px!important;letter-spacing:10px!important}

/* Love message strip: actual requested wording + emoji, kept away from the photo. */
.love-letter-strip{margin:26px 0 30px!important;padding:30px 24px!important}
.love-letter-head h2{font-size:clamp(28px,5vw,44px)!important;color:#49363c!important}
.love-letter-head p{font-family:'Tajawal',sans-serif!important;font-size:16px!important;line-height:2!important;color:#765f64!important}
.love-pills{gap:10px!important}
.love-pills span{font-family:'Tajawal',sans-serif!important;font-weight:600!important;background:rgba(255,255,255,.8)!important}

/* Small animated love objects around every page section. */
.app-page-section{position:relative!important;isolation:isolate}
.app-page-section > :not(.page-decor){position:relative;z-index:1}
.page-decor{position:absolute!important;inset:0!important;pointer-events:none!important;z-index:0!important;overflow:hidden!important}
.page-decor .decor-item{position:absolute!important;width:38px!important;height:38px!important;border-radius:50%!important;display:grid!important;place-items:center!important;background:rgba(255,250,247,.78)!important;border:1px solid rgba(167,93,109,.15)!important;box-shadow:0 10px 28px rgba(83,54,62,.09)!important;font-size:17px!important;animation:pageDecorFloat 5.5s ease-in-out infinite!important}
.page-decor .decor-item svg{width:21px;height:21px;display:block}
.page-decor .decor-a{top:18px;right:3%;animation-delay:-.7s!important}.page-decor .decor-b{top:42%;left:1%;animation-delay:-2.1s!important}.page-decor .decor-c{bottom:18px;right:7%;animation-delay:-3.3s!important}.page-decor .decor-d{bottom:28%;left:5%;animation-delay:-1.4s!important}
@keyframes pageDecorFloat{0%,100%{transform:translate3d(0,0,0) rotate(-4deg)}50%{transform:translate3d(0,-9px,0) rotate(4deg)}}

/* Make the smaller sections feel intentionally designed instead of empty. */
.simple-section{min-height:460px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;position:relative!important;overflow:hidden!important}
.simple-section h2{max-width:720px!important}
.simple-section p{max-width:620px!important;line-height:2!important}
.media-section,.collection-section,.book-preview,.home-dashboard,.little-note{position:relative!important}

@media(max-width:700px){
  .main-content{padding-left:14px!important;padding-right:14px!important;padding-bottom:102px!important}
  .hero-section{padding:28px 0 34px!important;gap:22px!important}
  .hero-copy{align-items:center!important;text-align:center!important;padding:0 6px!important}
  .hero-copy h1{font-size:clamp(34px,10.5vw,48px)!important;line-height:1.28!important;letter-spacing:-.4px!important;margin-top:8px!important}
  .hero-copy>p{font-size:15px!important;line-height:1.95!important;max-width:350px!important;margin:13px auto 17px!important}
  .hero-signature{font-size:18px!important;margin-top:2px!important}
  .hero-visual{min-height:0!important;margin-top:2px!important;padding:0 1px!important}
  .hero-photo{width:100%!important;padding:8px!important;border-radius:27px!important}
  .hero-photo img{aspect-ratio:4/3!important;border-radius:21px!important}
  .photo-caption{margin:10px 1px 0!important;padding:14px 15px!important;border-radius:18px!important}
  .photo-caption p{font-size:17px!important;line-height:1.75!important}
  .love-world{inset:auto 0 auto 0!important;top:0!important;height:315px!important}
  .love-couple-svg{width:27%!important;right:-3px!important;bottom:4px!important}
  .mini-love{width:29px!important;height:29px!important;font-size:14px!important}
  .mini-home{left:-5px!important;bottom:27%!important}.mini-heart{right:-5px!important;bottom:37%!important}.mini-hug{left:-2px!important;top:34%!important}.mini-ring{right:7%!important;top:3%!important}.mini-rose{left:17%!important;top:-3%!important}.mini-letter{right:25%!important;top:-5%!important}.mini-gift{right:-4px!important;bottom:12%!important}.mini-star{left:38%!important;top:12%!important}
  .love-letter-strip{margin:20px 0 24px!important;padding:22px 17px!important;border-radius:23px!important}
  .love-letter-head h2{font-size:26px!important;line-height:1.55!important}
  .love-letter-head p{font-size:14px!important;line-height:2!important}
  .love-pills{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}
  .love-pills span{font-size:11px!important;text-align:center!important;padding:9px 7px!important}
  .together-counter{margin-top:13px!important;padding:20px 16px!important;border-radius:22px!important}
  .page-decor .decor-item{width:31px!important;height:31px!important;font-size:14px!important;opacity:.88!important}
  .page-decor .decor-a{top:8px;right:1%}.page-decor .decor-b{left:-5px;top:48%}.page-decor .decor-c{right:1%;bottom:10px}.page-decor .decor-d{left:2%;bottom:28%}
  .simple-section{min-height:520px!important;padding:70px 24px!important;margin:25px 0!important}
}
@media(max-width:430px){
  .hero-copy h1{font-size:35px!important}
  .hero-copy>p{font-size:14px!important}
  .love-couple-svg{width:25%!important}
  .photo-caption p{font-size:16px!important}
}
@media(prefers-reduced-motion:reduce){.page-decor .decor-item{animation:none!important}.love-couple-svg{animation:none!important}}

/* =========================================================
   v29 — WRITE INSIDE THE REAL BOOK
   The editor is now a physical keepsake page: title, date and
   handwriting sit directly on the paper instead of looking like a form.
   ========================================================= */
.real-writing-book{
  position:relative;
  width:min(760px,100%);
  margin:18px auto 28px;
  padding:10px;
  perspective:1400px;
}
.writing-paper-shadow{
  position:absolute;
  inset:18px 8px 4px;
  background:rgba(72,48,40,.18);
  filter:blur(16px);
  border-radius:4px;
  transform:rotate(.35deg);
}
.writing-paper{
  position:relative;
  z-index:1;
  min-height:700px;
  padding:34px 42px 34px;
  border:1px solid rgba(135,96,78,.22);
  border-radius:3px 3px 8px 3px;
  background:
    linear-gradient(90deg,rgba(126,86,65,.10),transparent 8%,transparent 92%,rgba(126,86,65,.04)),
    repeating-linear-gradient(0deg,rgba(126,92,71,.035) 0,rgba(126,92,71,.035) 1px,transparent 1px,transparent 6px),
    #fffaf0;
  box-shadow:0 18px 38px rgba(72,49,42,.16), inset 0 0 40px rgba(120,83,61,.045);
  overflow:hidden;
}
.writing-paper:before{
  content:"";
  position:absolute;
  top:0; bottom:0; left:28px;
  width:1px;
  background:rgba(177,113,113,.13);
}
.writing-paper-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#b18e82;
  font:500 9px/1.2 'DM Sans',sans-serif;
  letter-spacing:.18em;
  text-transform:uppercase;
}
.writing-page-no{letter-spacing:.08em}
.writing-title-wrap{margin:34px 0 8px}
.writing-title{
  width:100% !important;
  border:0 !important;
  outline:0 !important;
  background:transparent !important;
  padding:0 !important;
  color:#634b44 !important;
  font:400 clamp(30px,6vw,48px)/1.1 'Aref Ruqaa','Amiri','Caveat',cursive !important;
  text-align:left;
}
.writing-title::placeholder{color:#c6aaa0;opacity:.75}
.writing-underline{
  display:block;
  width:100%;
  height:1px;
  margin-top:9px;
  background:linear-gradient(90deg,#b98984,rgba(185,137,132,.08));
}
.writing-meta-row{
  display:flex;
  gap:28px;
  align-items:flex-end;
  margin:20px 0 14px;
  color:#9c7f75;
  font:500 10px/1.3 'Tajawal',sans-serif;
}
.writing-meta-row label{display:flex;flex-direction:column;gap:4px;margin:0 !important}
.writing-meta-row input,.writing-meta-row select{
  width:auto !important;
  min-width:135px;
  border:0 !important;
  border-bottom:1px dashed rgba(150,111,96,.35) !important;
  border-radius:0 !important;
  background:transparent !important;
  padding:4px 0 !important;
  color:#765b53 !important;
  font:500 12px 'Tajawal',sans-serif !important;
}
.writing-meta-row select{min-width:120px}
.ink-writing-area{
  position:relative;
  margin-top:18px;
  min-height:365px;
  padding:8px 5px 8px 26px;
  background:repeating-linear-gradient(to bottom,transparent 0,transparent 37px,rgba(151,111,96,.16) 38px);
}
.ink-glyph{
  position:absolute;
  top:4px;
  left:-2px;
  color:#bd8d89;
  font-size:22px;
  transform:rotate(-15deg);
}
.memory-content-paper{
  min-height:355px;
  outline:none;
  border:0;
  color:#654c45;
  white-space:pre-wrap;
  word-break:break-word;
  font:400 24px/38px 'Aref Ruqaa','Amiri','Caveat',cursive;
  caret-color:#a85c68;
  direction:rtl;
  text-align:right;
}
.memory-content-paper:empty:before{
  content:attr(data-placeholder);
  color:#bca49c;
  opacity:.72;
  pointer-events:none;
}
.memory-content-paper:focus:empty:before{opacity:.45}
.memory-content-sync{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
  border:0 !important;
  padding:0 !important;
  margin:0 !important;
}
.writing-signature{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:12px;
  margin-top:22px;
  color:#aa8a80;
  font:400 16px 'Aref Ruqaa','Amiri','Caveat',cursive;
}
.writing-signature b{font-size:28px;color:#b86e76;font-weight:400}
.writing-paper .book-media-picker{
  margin-top:22px;
  padding-top:18px;
  border-top:1px dashed rgba(151,111,96,.2);
}
.writing-paper .editor-actions{margin-top:20px}
.writing-paper .dark-button{box-shadow:0 10px 22px rgba(91,45,56,.15)}

@media(max-width:768px){
  .real-writing-book{padding:5px;margin-top:8px}
  .writing-paper{min-height:690px;padding:25px 25px 28px 31px}
  .writing-paper:before{left:20px}
  .writing-paper-top{font-size:7px}
  .writing-title-wrap{margin-top:28px}
  .writing-title{font-size:34px !important}
  .writing-meta-row{gap:14px;flex-wrap:wrap;margin-top:16px}
  .writing-meta-row input,.writing-meta-row select{min-width:105px !important;font-size:11px !important}
  .ink-writing-area{min-height:340px;padding-left:17px}
  .memory-content-paper{min-height:330px;font-size:21px;line-height:35px}
  .writing-signature{font-size:14px}
}

@media(prefers-reduced-motion:reduce){
  .writing-paper{transform:none !important}
}

/* =========================================================
   V30 — REAL HANDWRITTEN BOOK / FINAL POLISH
   ========================================================= */
.book-modal{background:#efe2d6!important;color:#59463f!important;}
.book-modal-header h2{font-family:'DM Serif Display','Playfair Display',serif!important;letter-spacing:-.03em!important;}
.book-modal-header p{font-family:'Tajawal',sans-serif!important;}

/* Writing page: paper first, controls second */
.real-writing-book{position:relative;max-width:920px;margin:8px auto 34px;padding:14px 8px 28px;}
.writing-paper{position:relative;overflow:hidden;min-height:700px;padding:58px 66px 48px;background:#fffdf6;border:1px solid rgba(119,91,76,.22);border-radius:3px;box-shadow:0 30px 70px rgba(72,48,40,.18),inset 0 0 0 1px rgba(255,255,255,.7);}
.writing-paper:before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(139,102,79,.045),transparent 8%,transparent 92%,rgba(139,102,79,.035)),repeating-linear-gradient(0deg,transparent 0 35px,rgba(155,120,101,.12) 35px 36px);opacity:.78;}
.writing-paper:after{content:"";position:absolute;left:0;top:0;bottom:0;width:9px;background:linear-gradient(90deg,rgba(100,67,52,.10),transparent);pointer-events:none;}
.writing-paper-shadow{position:absolute;inset:22px 18px 8px;transform:rotate(-.35deg);background:#d9c8b8;filter:blur(1px);z-index:0;border-radius:3px;}
.writing-paper>*{position:relative;z-index:2;}
.writing-paper-top{display:flex;justify-content:space-between;align-items:center;gap:16px;color:#aa8779;font:600 10px/1 'Tajawal',sans-serif;letter-spacing:.13em;text-transform:uppercase;margin-bottom:30px;}
.writing-page-no{font-family:'Caveat',cursive;font-size:18px;letter-spacing:0;color:#9c7469;}
.writing-chapter{font-family:'Tajawal',sans-serif;}
.writing-title-wrap{position:relative;margin-bottom:24px;}
.writing-title{width:100%;border:0!important;outline:0!important;background:transparent!important;color:#4f3c37!important;font:700 clamp(34px,5vw,54px)/1.05 'Aref Ruqaa','Caveat',cursive!important;padding:0 0 8px!important;letter-spacing:-.02em;box-shadow:none!important;}
.writing-title::placeholder{color:#b79e94;opacity:.62;}
.writing-underline{display:block;width:135px;height:2px;background:linear-gradient(90deg,#b7837c,transparent);transform:rotate(-1deg);}
.writing-meta-row{display:flex;gap:28px;align-items:end;margin-bottom:26px;max-width:560px;}
.writing-meta-row label{display:flex;flex-direction:column;gap:6px;color:#a08176;font:600 10px/1 'Tajawal',sans-serif;letter-spacing:.06em;}
.writing-meta-row input,.writing-meta-row select{border:0!important;border-bottom:1px dashed #cdb9ad!important;border-radius:0!important;background:transparent!important;color:#6b5048!important;outline:0!important;padding:5px 2px!important;font:500 15px 'Tajawal',sans-serif!important;box-shadow:none!important;}
.writing-meta-row input{font-family:'Caveat','Tajawal',cursive!important;font-size:20px!important;}
.ink-writing-area{position:relative;min-height:330px;margin:4px 0 18px;padding:8px 10px 12px 46px;}
.ink-writing-area:before{content:"";position:absolute;left:25px;top:0;bottom:0;width:1px;background:rgba(184,113,111,.18);}
.ink-glyph{position:absolute;left:4px;top:3px;font:400 28px 'Caveat',cursive;color:#a97670;transform:rotate(-14deg);}
.memory-content-paper{min-height:300px;outline:none;white-space:pre-wrap;word-break:break-word;color:#58433d;font:400 26px/1.48 'Aref Ruqaa','Caveat',cursive;letter-spacing:.01em;caret-color:#9c5d62;text-align:left;direction:rtl;}
.memory-content-paper:empty:before{content:attr(data-placeholder);color:#bda9a0;opacity:.62;pointer-events:none;}
.memory-content-paper::selection,.writing-title::selection{background:rgba(184,124,119,.22);}
.memory-content-sync{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;}
.writing-signature{display:flex;justify-content:flex-end;gap:9px;align-items:center;color:#a38479;font:400 20px 'Aref Ruqaa','Caveat',cursive;transform:rotate(-1.2deg);}
.writing-signature b{font-size:30px;color:#b97878;font-weight:400;}
.book-media-picker{margin-top:28px;display:flex;flex-wrap:wrap;gap:10px;}
.book-media-pick .book-file-label{font-family:'Tajawal',sans-serif!important;border-radius:999px!important;padding:10px 15px!important;background:rgba(255,255,255,.62)!important;border:1px solid #d9c7bb!important;color:#725a52!important;}
.book-media-selection{margin-top:10px;display:flex;flex-wrap:wrap;gap:8px;}
.editor-actions{margin-top:24px!important;display:flex;justify-content:space-between;align-items:center;gap:12px;}
.editor-actions .dark-button{min-width:180px;}

/* Little physical-book details */
.real-writing-book:before{content:"";position:absolute;right:25px;top:32px;width:74px;height:24px;background:rgba(217,190,169,.52);transform:rotate(5deg);box-shadow:0 3px 7px rgba(75,52,44,.12);z-index:4;clip-path:polygon(0 0,100% 10%,92% 100%,7% 92%);}
.real-writing-book:after{content:"✦";position:absolute;left:24px;bottom:18px;color:#b8897f;font:26px 'Caveat',cursive;transform:rotate(-12deg);z-index:4;}

/* Opened page: handwritten ink, not application text */
.right-paper.opened-page{background:#fffdf6!important;overflow:hidden;}
.right-paper.opened-page:after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,transparent 0 37px,rgba(155,120,101,.09) 37px 38px);opacity:.7;}
.right-paper.opened-page h2{font-family:'Aref Ruqaa','Caveat',cursive!important;font-size:clamp(38px,5vw,62px)!important;line-height:1!important;font-weight:400!important;color:#523e39!important;}
.opened-content{position:relative;z-index:2;font-family:'Aref Ruqaa','Caveat',cursive!important;font-size:27px!important;line-height:1.55!important;color:#624c46!important;white-space:pre-wrap!important;direction:rtl;text-align:right;}
.opened-content:first-letter{font-size:1.55em;color:#ad716f;}
.opened-author{font-family:'Caveat','Tajawal',cursive!important;font-size:18px!important;color:#a37e74!important;}
.opened-footer{font-family:'Aref Ruqaa','Caveat',cursive!important;font-size:20px!important;color:#a38379!important;}
.book-page-number{font-family:'Caveat',cursive!important;font-size:18px!important;color:#a57b72!important;}
.book-writing-prompt h3{font-family:'Aref Ruqaa','Caveat',cursive!important;font-size:30px!important;font-weight:400!important;}
.book-writing-prompt p{font-family:'Tajawal',sans-serif!important;}

/* Real page-turn feel */
.real-book-reader{perspective:1600px;transform-style:preserve-3d;}
.real-book-reader .right-paper.opened-page{transform-origin:left center;backface-visibility:hidden;}
.real-book-reader.turn-next .right-paper.opened-page{animation:realPageTurnNext .46s cubic-bezier(.2,.75,.2,1) both;}
.real-book-reader.turn-prev .right-paper.opened-page{animation:realPageTurnPrev .46s cubic-bezier(.2,.75,.2,1) both;}
@keyframes realPageTurnNext{0%{transform:rotateY(0) translateZ(0);filter:none}45%{transform:rotateY(-78deg) translateZ(5px);filter:brightness(.93)}100%{transform:rotateY(0) translateZ(0);filter:none}}
@keyframes realPageTurnPrev{0%{transform:rotateY(0) translateZ(0);filter:none}45%{transform:rotateY(78deg) translateZ(5px);filter:brightness(.93)}100%{transform:rotateY(0) translateZ(0);filter:none}}
.book-page-controls{align-items:center!important;gap:14px!important;}
.book-secondary-actions{display:flex;gap:8px;align-items:center;justify-content:center;flex-wrap:wrap;}
#editMemory{border-color:#c9aaa0!important;color:#765950!important;background:rgba(255,255,255,.6)!important;}

@media (max-width:700px){
  .book-modal{padding:18px 10px 24px!important;}
  .book-modal-header{padding:6px 42px 12px 4px!important;}
  .book-modal-header h2{font-size:40px!important;}
  .real-writing-book{margin:0 auto 20px;padding:8px 3px 18px;}
  .writing-paper{min-height:650px;padding:40px 25px 30px;border-radius:2px;box-shadow:0 18px 38px rgba(72,48,40,.16);}
  .writing-paper:after{width:6px;}
  .writing-paper-top{font-size:8px;margin-bottom:24px;}
  .writing-title{font-size:42px!important;line-height:1.08!important;}
  .writing-meta-row{gap:15px;flex-wrap:wrap;margin-bottom:18px;}
  .writing-meta-row label{font-size:9px;}
  .ink-writing-area{min-height:310px;padding-left:30px;}
  .ink-writing-area:before{left:14px;}
  .ink-glyph{left:-2px;font-size:24px;}
  .memory-content-paper{min-height:280px;font-size:24px;line-height:1.58;}
  .writing-signature{font-size:18px;}
  .book-media-picker{margin-top:22px;}
  .editor-actions{flex-direction:column-reverse;align-items:stretch!important;}
  .editor-actions button{width:100%;}
  .real-writing-book:before{right:14px;top:17px;width:56px;height:20px;}
  .real-writing-book:after{left:14px;bottom:6px;}
  .right-paper.opened-page{padding:40px 25px 46px!important;}
  .opened-content{font-size:24px!important;line-height:1.65!important;}
  .right-paper.opened-page h2{font-size:43px!important;}
  .book-page-controls{flex-direction:column!important;}
  .book-page-nav{width:100%;justify-content:space-between!important;}
  .book-secondary-actions{width:100%;}
  #editMemory,#deleteMemory{flex:1;min-height:44px;}
}

@media (prefers-reduced-motion:reduce){
  .real-book-reader.turn-next .right-paper.opened-page,.real-book-reader.turn-prev .right-paper.opened-page{animation:none;}
}

/* =========================================================
   PHOTO EDITOR — CROP / ZOOM / PAN / ROTATE
   ========================================================= */
body.image-editor-open{overflow:hidden!important}
.image-editor-overlay{position:fixed;inset:0;z-index:5000;background:rgba(47,31,27,.66);display:flex;align-items:center;justify-content:center;padding:18px;}
.image-editor-overlay[hidden]{display:none!important}
.image-editor-modal{width:min(980px,100%);max-height:min(92vh,900px);overflow:auto;background:#fffaf4;border:1px solid #ead8cc;border-radius:24px;box-shadow:0 30px 100px rgba(35,22,18,.34);color:#5c4740;}
.image-editor-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:22px 24px 14px;border-bottom:1px solid #eadbd1;}
.image-editor-kicker{display:block;font:700 9px/1 'Tajawal',sans-serif;letter-spacing:.18em;color:#b08478;margin-bottom:7px;}
.image-editor-head h3{margin:0;font:500 30px/1.1 'Aref Ruqaa','Tajawal',sans-serif;color:#503c36;}
.image-editor-close{width:40px;height:40px;border-radius:50%;border:1px solid #dfcbc0;background:#fff;color:#7a5c53;font-size:25px;cursor:pointer;}
.image-editor-workspace{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr);gap:18px;padding:18px 24px;}
.image-editor-stage{position:relative;min-height:470px;border-radius:18px;overflow:hidden;background:#eadbce;touch-action:none;user-select:none;}
.image-editor-stage canvas{position:absolute;inset:0;display:block;}
.image-editor-crop-frame{position:absolute;pointer-events:none;border:2px solid rgba(255,255,255,.96);box-shadow:0 0 0 9999px rgba(30,20,17,.16),0 0 0 1px rgba(78,49,40,.3);border-radius:4px;}
.image-editor-crop-frame:before,.image-editor-crop-frame:after{content:"";position:absolute;inset:33.33%;border-left:1px solid rgba(255,255,255,.5);border-right:1px solid rgba(255,255,255,.5);}
.image-editor-crop-frame:after{inset:0 33.33%;border-left:0;border-right:0;border-top:1px solid rgba(255,255,255,.5);border-bottom:1px solid rgba(255,255,255,.5);}
.image-editor-controls{display:flex;flex-direction:column;gap:14px;padding:8px 2px;}
.image-editor-control-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.image-editor-range-label{flex:1;min-width:150px;display:flex;align-items:center;gap:10px;font:600 11px 'Tajawal',sans-serif;color:#765d55;}
.image-editor-range-label input{flex:1;accent-color:#a97870;}
.image-editor-tool,.image-editor-preset{border:1px solid #dfcfc5;background:#fff;color:#745a52;border-radius:12px;min-height:42px;padding:0 14px;font:600 11px 'Tajawal',sans-serif;cursor:pointer;}
.image-editor-tool{min-width:42px;font-size:17px;}
.image-editor-tool.wide{flex:1;font-size:11px;}
.image-editor-preset.active{background:#795b52;color:#fff;border-color:#795b52;}
.image-editor-hint{margin:0;padding:13px 14px;border-radius:14px;background:#f5ebe4;color:#8a7168;font:500 12px/1.65 'Tajawal',sans-serif;}
.image-editor-actions{display:flex;justify-content:flex-end;gap:10px;padding:14px 24px 22px;border-top:1px solid #eadbd1;}
.image-editor-actions button{min-height:44px;min-width:130px;}
.book-media-chip.image-chip{grid-template-columns:56px minmax(0,1fr) auto auto!important;}
.book-media-chip > button.book-media-edit{border-color:#dcc5b9;background:#fff7f1;color:#805e55;}
.opened-photo-item{position:relative;min-width:0;}
.opened-photo-item .opened-photo-edit{position:absolute;right:10px;bottom:10px;border:1px solid rgba(255,255,255,.8);background:rgba(74,48,40,.86);color:#fff;border-radius:999px;padding:8px 11px;font:600 10px 'Tajawal',sans-serif;cursor:pointer;box-shadow:0 5px 15px rgba(40,25,20,.18);}
.opened-photo-item img{width:100%;height:100%;display:block;object-fit:cover;}
@media(max-width:760px){
  .image-editor-overlay{padding:8px;align-items:flex-end;}
  .image-editor-modal{max-height:96vh;border-radius:22px 22px 0 0;}
  .image-editor-head{padding:17px 16px 12px;}
  .image-editor-head h3{font-size:25px;}
  .image-editor-workspace{display:block;padding:12px 14px 10px;}
  .image-editor-stage{height:min(58vh,470px);min-height:300px;}
  .image-editor-controls{padding-top:12px;gap:10px;}
  .image-editor-actions{padding:12px 14px 16px;}
  .image-editor-actions button{flex:1;min-width:0;}
}

/* v32 — instant book navigation + universal photo editing */
.real-book-reader.page-switching .right-paper.opened-page,
.real-book-reader.page-switching .left-paper {
  animation: bookPageSnap .14s ease-out both !important;
}
@keyframes bookPageSnap {
  from { opacity:.35; transform:translateX(10px); }
  to { opacity:1; transform:none; }
}
.media-item { position:relative; }
.media-edit {
  position:absolute; top:10px; right:10px; z-index:3;
  border:1px solid rgba(255,255,255,.45); border-radius:999px;
  background:rgba(48,29,25,.88); color:#fff; padding:7px 10px;
  cursor:pointer; font:600 12px/1 inherit; backdrop-filter:blur(8px);
}
.opened-photo-item { position:relative; }
.opened-photo-edit {
  position:absolute; right:8px; bottom:8px; z-index:3;
  border:0; border-radius:999px; padding:7px 10px;
  background:rgba(55,34,29,.9); color:#fff; cursor:pointer;
}
.settings-photo-preview { position:relative; }
.settings-photo-edit {
  display:block; margin:8px auto 0; border:1px solid rgba(94,63,53,.22);
  border-radius:999px; padding:8px 13px; background:#fff8f2;
  color:#5d4036; cursor:pointer;
}
.hero-photo { position:relative; }
.hero-photo .hero-photo-edit {
  position:absolute; right:12px; top:12px; z-index:5;
  border:1px solid rgba(255,255,255,.5); border-radius:999px;
  padding:8px 12px; background:rgba(55,34,29,.86); color:#fff;
  cursor:pointer; backdrop-filter:blur(8px);
}
@media (max-width:700px){
  .media-edit,.opened-photo-edit { padding:6px 9px; font-size:11px; }
  .hero-photo .hero-photo-edit { right:8px; top:8px; }
}

/* Book exit button — enlarged touch target for phones */
@media (max-width: 700px) {
  .modal-overlay { padding: 14px; }
  .book-modal { width: 100%; max-height: 94vh; }
  .modal-close { top: 10px; right: 10px; width: 56px; height: 56px; font-size: 36px; }
}

/* ===== V34 BOOK + ACCOUNT SECURITY ===== */
.book-reading-tools{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;margin:14px auto 0}
.book-saved-page{font-size:11px;color:#9c7f74;letter-spacing:.4px}
.book-end-note{margin:18px auto 0;max-width:620px;padding:26px 20px;text-align:center;border:1px solid rgba(141,91,80,.18);border-radius:24px;background:linear-gradient(180deg,rgba(255,250,244,.9),rgba(248,235,226,.72));box-shadow:0 14px 40px rgba(75,53,43,.08)}
.book-end-note.hidden{display:none}
.book-end-flower{font-size:32px;color:#b98780}
.book-end-note h3{margin:8px 0;font-family:'Aref Ruqaa','Caveat',cursive;font-size:28px;color:#674a43}
.book-end-note p{margin:0 0 16px;color:#9a8178;font-size:12px}
.account-device-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;margin:10px 0 12px;border:1px solid rgba(141,91,80,.16);border-radius:14px;background:rgba(255,250,246,.6);font-size:12px;color:#725d55}
.device-limit-badge{padding:5px 9px;border-radius:999px;background:#f1e2dc;color:#8b625b;font-size:10px;white-space:nowrap}
.settings-remove{cursor:pointer}
.book-reading-focus .book-modal-header,.book-reading-focus .book-toolbar,.book-reading-focus .book-reading-tools,.book-reading-focus .book-page-controls,.book-reading-focus .book-end-note{display:none!important}
.book-reading-focus .book-modal{max-width:1100px}
.book-reading-focus .real-book-reader{min-height:72vh}
@media(max-width:700px){
 .book-reading-tools{margin-top:10px}
 .book-reading-tools .outline-account{font-size:10px;padding:9px 11px}
 .book-saved-page{width:100%;text-align:center}
 .account-device-row{font-size:11px}
 .book-end-note h3{font-size:24px}
}

/* ===== PWA INSTALL ===== */
.install-app-button{
  border:1px solid rgba(183,125,119,.34);
  background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(247,235,231,.92));
  color:#6d4744;
  border-radius:999px;
  padding:9px 14px;
  font:600 12px/1.1 var(--app-font,inherit);
  cursor:pointer;
  box-shadow:0 8px 24px rgba(74,46,43,.08);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.install-app-button:hover{transform:translateY(-1px);box-shadow:0 12px 30px rgba(74,46,43,.13);border-color:rgba(183,125,119,.55)}
.install-app-button:active{transform:translateY(0)}
.install-app-button[hidden]{display:none!important}
.settings-install-button{margin-top:8px;min-height:42px}
.install-status{display:block;margin-top:9px;color:#8a6d68;font-size:11px;line-height:1.6}
@media(max-width:760px){
  .top-right{gap:6px}
  .top-right .install-app-button{padding:8px 10px;font-size:11px}
  .top-right .settings-trigger{padding:8px 10px}
}
