.my-wander-page {
    background:
        radial-gradient(circle at 85% 6%, rgba(var(--accent-rgb), .18), transparent 27rem),
        var(--paper);
}

.wander-main { padding: 40px 0 70px; }
.wander-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 54px;
    align-items: end;
    padding: clamp(34px, 6vw, 72px);
    border-radius: 36px;
    background: var(--forest);
    color: var(--white);
    box-shadow: var(--shadow);
}
.wander-hero::after {
    content: "";
    position: absolute;
    width: 340px;
    height: 340px;
    right: -110px;
    top: -160px;
    border: 1px solid rgba(var(--accent-rgb), .2);
    border-radius: 50%;
    box-shadow: 0 0 0 42px rgba(var(--accent-rgb), .025), 0 0 0 84px rgba(var(--accent-rgb), .025);
}
.wander-hero-copy { position: relative; z-index: 1; }
.wander-hero .eyebrow { color: var(--lime); }
.wander-hero h1 { margin: 0; font: 700 clamp(3.6rem, 8vw, 7.6rem)/.82 Georgia, serif; letter-spacing: -.075em; }
.wander-hero h1 em { color: var(--lime); font-weight: 400; }
.wander-hero-copy > p:not(.eyebrow) { max-width: 610px; margin: 28px 0; color: rgba(255, 255, 255, .69); font-size: clamp(1rem, 1.6vw, 1.17rem); line-height: 1.65; }
.add-memory-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 19px;
    border: 0;
    border-radius: 999px;
    background: var(--lime);
    color: var(--forest);
    font-weight: 850;
    cursor: pointer;
}
.add-memory-button span { font-size: 1.25rem; }
.wander-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 26px;
    background: rgba(255,255,255,.055);
    backdrop-filter: blur(10px);
}
.wander-stats div { min-width: 0; padding: 24px; }
.wander-stats div:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.1); }
.wander-stats div:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.1); }
.wander-stats strong { display: block; color: var(--lime); font: 700 2.25rem/1 Georgia, serif; }
.wander-stats span { display: block; margin-top: 6px; color: rgba(255,255,255,.58); font-size: .7rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.wander-toolbar { display: flex; gap: 20px; align-items: center; justify-content: space-between; margin: 35px 0 24px; }
.filter-scroll { display: flex; gap: 7px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.5); color: var(--muted); font-size: .8rem; font-weight: 780; cursor: pointer; }
.filter-chip.active { border-color: var(--forest); background: var(--forest); color: var(--lime); }
.journey-link { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; color: var(--teal); font-size: .8rem; font-weight: 850; }
.memory-status { padding: 50px 0; color: var(--muted); text-align: center; }
.memory-grid { columns: 3 280px; column-gap: 20px; }
.memory-card { position: relative; overflow: hidden; break-inside: avoid; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 24px; background: var(--white); box-shadow: 0 12px 34px rgba(7,27,25,.07); }
.memory-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #dce5df; }
.memory-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.memory-card:hover .memory-photo img { transform: scale(1.035); }
.media-share-button { position: absolute; right: 10px; top: 10px; z-index: 2; padding: 8px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(7,27,25,.88); color: white; font-size: .68rem; font-weight: 850; cursor: pointer; backdrop-filter: blur(10px); }
.media-share-button:disabled { cursor: wait; opacity: .75; }
.photo-count { position: absolute; right: 12px; bottom: 12px; padding: 6px 9px; border-radius: 999px; background: rgba(7,27,25,.82); color: white; font-size: .7rem; font-weight: 800; backdrop-filter: blur(8px); }
.memory-videos { display: grid; gap: 2px; background: var(--forest); }
.memory-video { position: relative; }
.memory-videos video { display: block; width: 100%; max-height: 470px; aspect-ratio: 16 / 9; background: #020706; object-fit: contain; }
.memory-video-count { padding: 7px 12px; background: var(--forest); color: rgba(255,255,255,.68); font-size: .68rem; font-weight: 800; text-align: right; }
.memory-card-body { padding: 22px; }
.memory-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.memory-type { display: inline-flex; gap: 6px; align-items: center; color: var(--teal); font-size: .67rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.memory-date { color: #84908b; font-size: .72rem; }
.memory-card h2 { margin: 0; font: 700 1.55rem/1.06 Georgia, serif; letter-spacing: -.035em; }
.memory-location { margin: 8px 0 0; color: var(--muted); font-size: .78rem; font-weight: 700; }
.memory-notes { margin: 15px 0 0; color: #53635d; font-size: .9rem; line-height: 1.58; white-space: pre-line; }
.memory-card.no-photo { border-top: 5px solid var(--lime); }
.memory-card.type-person.no-photo { border-top-color: var(--orange); }
.memory-card.type-bar.no-photo { border-top-color: #af8cff; }
.memory-card.type-vlog.no-photo { border-top-color: #ff6f61; }
.memory-empty { max-width: 580px; margin: 64px auto; text-align: center; }
.empty-postcard { position: relative; width: 140px; height: 106px; margin: 0 auto 28px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); transform: rotate(-4deg); box-shadow: var(--shadow); }
.empty-postcard span { position: absolute; top: 13px; right: 13px; display: grid; place-items: center; width: 30px; height: 34px; border: 2px dotted var(--teal); color: var(--teal); font: italic 700 1.1rem Georgia, serif; }
.empty-postcard i { position: absolute; left: 16px; bottom: 24px; width: 60px; border-top: 2px solid var(--line); box-shadow: 0 10px 0 var(--line), 0 20px 0 var(--line); }
.memory-empty h2 { margin: 0; font: 700 clamp(2rem, 5vw, 3rem)/1 Georgia, serif; }
.memory-empty > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.memory-empty button { border: 0; background: transparent; color: var(--teal); font-weight: 850; cursor: pointer; }

.memory-dialog { width: min(780px, calc(100% - 28px)); max-height: min(900px, calc(100dvh - 28px)); padding: 0; border: 0; border-radius: 30px; background: var(--white); color: var(--ink); box-shadow: 0 30px 100px rgba(7,27,25,.35); }
.memory-dialog::backdrop { background: rgba(7,27,25,.62); backdrop-filter: blur(7px); }
.memory-form { padding: 30px; }
.sheet-handle { display: none; }
.form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.form-header h2 { margin: 0; font: 700 2.2rem/1 Georgia, serif; letter-spacing: -.04em; }
.dialog-close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
.type-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin: 25px 0; padding: 0; border: 0; }
.type-picker legend { margin-bottom: 9px; color: var(--muted); font-size: .73rem; font-weight: 800; }
.type-picker label { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 11px 5px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: .7rem; font-weight: 750; cursor: pointer; }
.type-picker input { position: absolute; opacity: 0; pointer-events: none; }
.type-picker label:has(input:checked) { border-color: var(--forest); background: var(--forest); color: var(--lime); }
.type-picker label span { font-size: 1.15rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: .74rem; font-weight: 800; }
.field-wide { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; outline: 0; background: #faf9f5; color: var(--ink); font-weight: 500; }
.field input { height: 48px; padding: 0 14px; }
.field textarea { min-height: 116px; padding: 14px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,119,108,.1); }
.notes-field { position: relative; }
.ai-write-button { justify-self: start; margin-top: -1px; border: 0; background: transparent; color: var(--teal); font-size: .72rem; font-weight: 850; cursor: pointer; }
.photo-field, .video-field { margin-top: 19px; }
.photo-field > div:first-child, .video-field > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.photo-field strong, .video-field strong { font-size: .76rem; }
.photo-field > div span, .video-field > div span { color: var(--muted); font-size: .67rem; }
.photo-drop, .video-drop { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 8px; min-height: 70px; border: 1px dashed rgba(15,119,108,.42); border-radius: 15px; background: rgba(15,119,108,.035); color: var(--teal); cursor: pointer; }
.video-drop { border-color: rgba(255,111,97,.5); background: rgba(255,111,97,.045); color: #a94539; }
.photo-drop small, .video-drop small { color: var(--muted); }
.photo-preview { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.photo-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.video-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.video-preview video { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--forest); object-fit: contain; }
.form-message { min-height: 1.2em; margin: 13px 0 0; color: #a33f26; font-size: .78rem; }
.form-message.success { color: var(--teal); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-footer p { max-width: 360px; margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.form-footer button { flex: 0 0 auto; padding: 13px 18px; border: 0; border-radius: 999px; background: var(--forest); color: var(--lime); font-weight: 850; cursor: pointer; }
.form-footer button:disabled, .ai-write-button:disabled { opacity: .5; cursor: wait; }

@media (max-width: 760px) {
    .wander-main { padding-top: 15px; }
    .wander-hero { grid-template-columns: 1fr; gap: 30px; padding: 32px 24px; border-radius: 27px; }
    .wander-hero h1 { font-size: clamp(3.5rem, 18vw, 5.2rem); }
    .wander-hero-copy > p:not(.eyebrow) { margin: 20px 0; }
    .wander-stats div { padding: 18px; }
    .wander-toolbar { display: block; }
    .filter-scroll { margin-right: -14px; padding-right: 14px; }
    .journey-link { margin-top: 17px; }
    .memory-grid { columns: 1; }
    .memory-dialog { width: 100%; max-width: none; max-height: calc(100dvh - 12px); margin: auto 0 0; border-radius: 26px 26px 0 0; }
    .memory-form { padding: 12px 18px calc(20px + env(safe-area-inset-bottom)); }
    .sheet-handle { display: block; width: 42px; height: 4px; margin: 0 auto 18px; border-radius: 999px; background: var(--line); }
    .form-header h2 { font-size: 1.8rem; }
    .type-picker { grid-template-columns: repeat(3, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .photo-preview { grid-template-columns: repeat(4, 1fr); }
    .video-preview { grid-template-columns: 1fr; }
    .form-footer { align-items: stretch; flex-direction: column; }
    .form-footer button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .memory-photo img { transition: none; }
}
