.memory-page {
    width: min(100% - 32px, 1160px);
    margin: 24px auto 58px;
}

.memory-hero {
    position: relative;
    display: grid;
    align-items: end;
    min-height: 230px;
    padding: clamp(20px, 5vw, 50px);
    border-radius: 12px;
    background: linear-gradient(90deg, #183941b8, #183941eb), url('mountains.png') center 46% / cover;
    color: #fff;
}

.memory-hero h1 {
    margin: 4px 0 6px;
    font-size: clamp(27px, 4.5vw, 48px);
}

.memory-hero p { margin-bottom: 0; }
.memory-hero .eyebrow { color: #d9edf0; }
.memory-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.memory-body {
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(0, 1.25fr);
    align-items: start;
    gap: clamp(20px, 4vw, 46px);
    margin-top: 26px;
}

.memory-compose {
    padding: clamp(16px, 3vw, 28px);
    border: 1px solid #c7d9de;
    border-radius: 10px;
    background: #e8f0f2;
}

.memory-compose h2, .memory-list h2 { margin-bottom: 8px; }
.memory-compose p { margin-bottom: 15px; }
.memory-label {
    display: block;
    margin: 12px 0 4px;
    font-weight: 700;
}

.memory-field {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #819ea8;
    border-radius: 5px;
    background: #f9fcfc;
    color: #183941;
    font: inherit;
}

.memory-field:focus-visible { outline: 3px solid #ad4f31; outline-offset: 2px; }
.memory-field::placeholder { color: #526d76; opacity: 1; }
textarea.memory-field { min-height: 125px; resize: vertical; }
.memory-compose .button { margin-top: 18px; cursor: pointer; font: inherit; font-weight: 700; }
.memory-hint { color: #3f5c66; font-size: 14px; }
.memory-status {
    margin: 16px 0 0;
    padding: 10px 15px;
    border-inline-start: 4px solid #395f6c;
    background: #e1eef0;
}
.memory-status[role=alert] { border-inline-start-color: #8d3c29; background: #f8eae4; color: #672b1e; }

.memory-cards { display: grid; gap: 14px; }
.memory-card {
    padding: clamp(15px, 3vw, 23px);
    border: 1px solid #c7d9de;
    border-inline-start: 4px solid #648b97;
    border-radius: 8px;
    background: #f9fcfc;
    overflow-wrap: anywhere;
}
.memory-card h3 { margin: 2px 0 8px; }
.memory-story { white-space: pre-wrap; margin-bottom: 12px; }
.memory-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: #3f5c66; font-size: 14px; }
.memory-card details { margin-top: 8px; }
.memory-card summary { min-height: 44px; align-content: center; color: #703d2a; cursor: pointer; }
.memory-card .memory-remove {
    min-height: 44px;
    padding: 6px 12px;
    border: 1px solid #8b4535;
    border-radius: 5px;
    background: #fff6f2;
    color: #703d2a;
    cursor: pointer;
    font: inherit;
}
.memory-empty {
    padding: 22px;
    border: 1px dashed #91abb4;
    border-radius: 8px;
    background: #e7eff1;
}
.memory-empty p { margin-bottom: 0; }

@media (max-width: 760px) {
    .memory-page { margin-top: 14px; }
    .memory-hero { min-height: 185px; }
    .memory-body { grid-template-columns: 1fr; margin-top: 17px; }
    .memory-compose .button { width: 100%; }
}
