:root {
    --paper: #fff1f5;
    --paper-2: #fffaf7;
    --ink: #391b3d;
    --muted: #79536b;
    --line: rgba(124, 37, 99, 0.14);
    --rose: #b91c61;
    --rose-deep: #791653;
    --blush: #fce0ec;
    --gold: #976036;
    --shadow: 0 18px 50px rgba(114, 25, 103, 0.14);
    --romance: linear-gradient(135deg, #bc205d, #ab177c 58%, #65218d);
    --app-height: 100dvh;
    color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    color: var(--ink);
    font-family: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
    font-weight: 380;
    background:
        radial-gradient(ellipse at 8% 8%, #ffedce, transparent 55%),
        radial-gradient(ellipse at 95% 12%, #f49abb, transparent 60%),
        linear-gradient(145deg, #ffe2dc, #efb7d4 55%, #a776c1);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, video { max-width: 100%; }
::selection { background: #f8bfd9; }

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.app {
    position: relative;
    width: min(480px, 100%);
    height: var(--app-height);
    margin: 0 auto;
    background: var(--paper);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
@media (max-width: 859px) {
    .app {
        position: fixed;
        top: var(--vv-top, 0px);
        left: 0;
        right: 0;
        width: 100%;
    }
}

.screen { display: none; min-height: 0; }
.screen.is-on {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.chat {
    background: var(--paper);
}
.chat.is-mood {
    background: linear-gradient(168deg, var(--mood-a), var(--mood-b));
}
.chat.is-mood .topbar,
.chat.is-mood .composer {
    background: color-mix(in srgb, var(--mood-a) 86%, #fffaf6);
}

.boot {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    text-align: center;
    padding: 24px;
}
.boot[hidden] { display: none; }
.boot h1 { margin: 0; }

.pulse {
    width: 8px;
    height: 8px;
    margin-top: 22px;
    border-radius: 50%;
    background: var(--rose);
    animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
    50% { transform: scale(0.7); opacity: 0.45; }
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--rose);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
h1, h2, .code-card strong {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 560;
    letter-spacing: -0.03em;
}
h1 { margin: 0; font-size: clamp(2.4rem, 8vw, 3.3rem); line-height: 0.95; }
.lede, .fine {
    color: var(--muted);
    line-height: 1.5;
}
.lede { margin: 14px 0 0; font-size: 1.02rem; }
.fine { margin: 18px 0 0; font-size: 0.86rem; }

.auth, .link { overflow: auto; }
.auth-wrap, .link-wrap {
    width: min(100%, 420px);
    margin: auto;
    padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
}
.auth-wrap { position: relative; }
.auth-wrap::before {
    content: "Us";
    position: absolute;
    right: 6px;
    top: 8px;
    font-family: "Fraunces", Georgia, serif;
    font-size: 7.5rem;
    line-height: 0.8;
    color: rgba(163, 61, 90, 0.07);
    pointer-events: none;
}

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 26px 0 16px;
    padding: 4px;
    background: rgba(36, 28, 25, 0.05);
    border-radius: 999px;
}
.tab, .ghost, .text-btn, .sheet-card button, .jump, .lightbox-close {
    border: 0;
    background: transparent;
}
.tab {
    border-radius: 999px;
    padding: 10px 12px;
    color: var(--muted);
}
.tab.is-on {
    background: var(--paper-2);
    color: var(--ink);
    box-shadow: 0 4px 16px rgba(36, 28, 25, 0.06);
}

.field { display: block; margin: 0 0 12px; }
.field span {
    display: block;
    margin: 0 0 6px;
    font-size: 0.82rem;
    color: var(--muted);
}
.field input, .composer textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--paper-2);
    border-radius: 14px;
    padding: 13px 14px;
    outline: none;
    font-size: 16px;
}
.field input:focus, .composer textarea:focus {
    border-color: rgba(163, 61, 90, 0.55);
    box-shadow: 0 0 0 4px rgba(163, 61, 90, 0.12);
}
#partner-code {
    font-family: "Fraunces", Georgia, serif;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 1.3rem;
    text-align: center;
}

.btn, .send.is-ready {
    background: var(--rose);
    color: #fffaf7;
}
.btn {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 14px 18px;
    font-weight: 600;
    margin-top: 6px;
}
.btn:hover, .send.is-ready:hover { background: var(--rose-deep); }
.btn:disabled { opacity: 0.6; }

.form-error {
    margin: 0 0 8px;
    color: var(--rose-deep);
    font-size: 0.92rem;
}
.form-error[hidden] { display: none; }

.code-card {
    margin: 22px 0 18px;
    padding: 18px;
    border-radius: 22px;
    background: var(--paper-2);
    box-shadow: var(--shadow);
    text-align: center;
}
.code-card span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.code-card strong {
    display: block;
    margin: 8px 0 12px;
    font-size: 2.4rem;
    letter-spacing: 0.12em;
}
.ghost {
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--blush);
    color: var(--rose-deep);
    font-weight: 600;
}
.text-btn {
    display: block;
    margin: 16px auto 0;
    color: var(--muted);
    padding: 8px 12px;
}

.top-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.call-btn { color: var(--rose-deep); }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px 14px;
    background: rgba(246, 240, 234, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-text { min-width: 0; }
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fffaf7;
    font-weight: 600;
    flex: none;
    overflow: hidden;
    background: #a33d5a;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.avatar img[hidden] { display: none !important; }
.who h2 {
    margin: 0;
    font-size: 1.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#presence { margin: 1px 0 0; color: var(--muted); font-size: 0.82rem; }
#presence.online { color: #2f7d54; }
#presence.typing { color: var(--rose); }
.together {
    margin: 1px 0 0;
    color: var(--gold);
    font-size: 0.75rem;
}
.nudge-btn { color: var(--rose); }
.icon-btn:disabled { opacity: 0.45; }

.milestone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 10px 12px 0;
    padding: 10px 8px 10px 14px;
    background: var(--blush);
    color: var(--rose-deep);
    border-radius: 14px;
}
.milestone p {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.05rem;
}
.milestone button {
    border: 0;
    background: transparent;
    color: var(--rose-deep);
    padding: 6px 10px;
    font-size: 0.86rem;
}

.icon-btn, .send {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--ink);
    flex: none;
}
.icon-btn:hover, .ghost:hover { background: rgba(36, 28, 25, 0.05); }
.icon-btn.call-btn { color: var(--rose); }
.attach { position: relative; }
.attach input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 16px;
}
.ghost:hover { background: #f3d5dc; }

.thread {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.empty {
    margin: auto;
    text-align: center;
    max-width: 260px;
    color: var(--muted);
}
.empty strong {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 560;
}
.day {
    align-self: center;
    margin: 14px 0 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(36, 28, 25, 0.05);
    color: var(--muted);
    font-size: 0.75rem;
}

.bubble {
    align-self: flex-start;
    max-width: min(82%, 320px);
    margin-top: 8px;
    padding: 9px 12px 8px;
    border-radius: 18px 18px 18px 6px;
    background: var(--paper-2);
    box-shadow: 0 8px 22px rgba(80, 40, 40, 0.04);
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}
.bubble.follow { margin-top: 3px; }
.bubble { position: relative; }
.bubble[data-id], .bubble.media[data-id], .bubble.sticker[data-id] { padding-top: 25px; min-width: 75px; }
.message-actions { position: absolute; right: 5px; top: 2px; z-index: 2; white-space: normal; }
.message-actions[open] { z-index: 4; }
.message-actions[open] { position: relative; top: auto; right: auto; margin-top: -23px; }
.message-actions[open] summary { text-align: right; }
.message-actions[open] .message-menu { position: static; max-width: 100%; margin-bottom: 8px; }
.message-actions summary { cursor: pointer; list-style: none; padding: 0 7px; border-radius: 8px; line-height: 23px; }
.message-actions summary::-webkit-details-marker { display: none; }
.message-actions summary:hover, .message-actions summary:focus-visible { background: rgba(0, 0, 0, 0.1); }
.message-menu { position: absolute; top: 25px; left: -22px; width: 230px; padding: 8px; border-radius: 14px; background: var(--paper-2); color: var(--ink); box-shadow: 0 5px 25px rgba(36, 28, 25, 0.2); }
.mine .message-menu { left: auto; right: 0; }
.message-menu button, .message-reactions button, .reply-preview button { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 8px; border-radius: 8px; }
.message-menu > button { display: block; width: 100%; text-align: left; }
.message-menu button:hover, .message-menu button:focus-visible { background: var(--blush); }
.reaction-choices { display: flex; }
.reaction-choices button { flex: 1; padding: 8px 3px; font-size: 20px; }
.reaction-choices [aria-pressed="true"], .message-reactions [aria-pressed="true"] { background: var(--blush); outline: 1px solid var(--rose); }
.message-reactions { display: flex; gap: 4px; margin: 4px 0; white-space: normal; }
.message-reactions button { background: var(--paper-2); color: var(--ink); padding: 3px 7px; font-size: 15px; }
.message-quote, .reply-preview { border: 0; border-left: 3px solid var(--rose-deep); border-radius: 8px; background: rgba(0, 0, 0, 0.07); padding: 8px 10px; color: inherit; text-align: left; white-space: normal; }
.message-quote { display: block; width: 100%; cursor: pointer; margin-bottom: 6px; max-width: 100%; }
.message-quote strong, .message-quote span, .reply-preview strong, .reply-preview span { display: block; }
.message-quote strong, .reply-preview strong { font-size: 12px; }
.message-quote span, .reply-preview span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-preview { display: flex; align-items: center; gap: 10px; margin: 0 5px 8px; }
.reply-preview > div { flex: 1; min-width: 0; }
.reply-preview button { font-size: 24px; }
.bubble.mine {
    align-self: flex-end;
    background: var(--rose);
    color: #fffaf7;
    border-radius: 18px 18px 6px 18px;
}
.bubble.media {
    padding: 4px;
    max-width: min(78%, 280px);
    white-space: normal;
}
.bubble.sticker {
    background: transparent;
    box-shadow: none;
    padding: 0;
    max-width: min(52%, 168px);
}
.bubble.sticker .photo,
.bubble.sticker .photo img {
    background: transparent;
    border-radius: 0;
}
.bubble.media .caption, .bubble .meta { white-space: normal; }
.bubble a { color: inherit; }
.bubble .meta {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.72rem;
    opacity: 0.8;
}
.bubble.failed { outline: 1px solid var(--rose); }
.retry {
    display: inline;
    border: 0;
    padding: 0;
    background: none;
    color: inherit;
    text-decoration: underline;
}
.photo, .bubble video, .file-card { display: block; border-radius: 14px; }
.photo {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    line-height: 0;
    appearance: none;
}
.photo img, .bubble video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    border-radius: 14px;
    background: #efe4db;
}
.bubble video { max-height: 320px; background: #1b1416; object-fit: contain; }
.file-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    padding: 8px;
    color: inherit;
    text-decoration: none;
}
.file-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex: none;
}
.bubble:not(.mine) .file-ico { background: var(--blush); color: var(--rose-deep); }
.file-card strong, .file-card small { display: block; }
.file-card small { opacity: 0.75; font-size: 0.75rem; }
.file-card strong {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.progress {
    height: 4px;
    margin: 8px 4px 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.28);
    overflow: hidden;
}
.bubble:not(.mine) .progress { background: rgba(36, 28, 25, 0.08); }
.progress span {
    display: block;
    height: 100%;
    width: 0;
    background: currentColor;
}
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 2px;
}
.typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: blink 1.1s infinite;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink {
    50% { opacity: 0.3; transform: translateY(1px); }
}
.removed { font-style: italic; opacity: 0.8; white-space: normal; }

.jump {
    position: absolute;
    left: 50%;
    bottom: calc(72px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 4;
    background: var(--ink);
    color: #fffaf7;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
    box-shadow: var(--shadow);
}
.jump[hidden] { display: none; }

.drop {
    position: absolute;
    inset: 64px 12px 78px;
    z-index: 3;
    display: grid;
    place-items: center;
    border: 1.5px dashed var(--rose);
    border-radius: 20px;
    background: rgba(246, 240, 234, 0.92);
    color: var(--rose-deep);
    font-weight: 600;
    text-align: center;
    padding: 20px;
}
.drop[hidden] { display: none; }

.composer {
    position: relative;
    z-index: 5;
    flex: none;
    width: 100%;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(246, 240, 234, 0.96);
    border-top: 1px solid var(--line);
}
.composer-bar {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
    min-width: 0;
}
.grow { position: relative; flex: 1; min-width: 0; }
.composer textarea {
    display: block;
    width: 100%;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    height: 44px;
    border-radius: 22px;
    padding: 10px 14px;
    line-height: 22px;
    font-size: 16px;
    overflow-x: hidden;
    overflow-y: hidden;
    background: var(--paper-2);
}
@media (max-width: 420px) {
    .composer .icon-btn,
    .composer .send {
        width: 36px;
        height: 36px;
    }
}
.send {
    background: rgba(36, 28, 25, 0.08);
    color: var(--muted);
}
.send.is-ready { color: #fffaf7; }

.emoji-pop {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(100% + 8px);
    z-index: 6;
    display: flex;
    flex-direction: column;
    height: min(340px, 52vh);
    padding: 8px 8px 6px;
    background: var(--paper-2);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.emoji-pop[hidden] { display: none; }
.picker-tabs, .picker-cats {
    display: flex;
    gap: 4px;
    flex: none;
}
.picker-tabs { margin-bottom: 6px; }
.picker-tabs button, .picker-cats button, .emoji-cell, .sticker-cell {
    border: 0;
    background: transparent;
}
.picker-tabs button {
    flex: 1;
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
}
.picker-tabs button.is-on {
    background: var(--blush);
    color: var(--rose-deep);
}
.picker-body, .sticker-grid {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.emoji-title {
    margin: 8px 6px 2px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.emoji-grid, .sticker-grid {
    display: grid;
    gap: 2px;
}
.emoji-grid { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.sticker-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); align-content: start; }
.emoji-cell {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    font-size: 1.35rem;
}
.emoji-cell:hover, .picker-cats button:hover, .sticker-cell:hover { background: var(--blush); }
.sticker-cell {
    aspect-ratio: 1;
    border-radius: 14px;
    padding: 6px;
}
.sticker-cell svg { width: 100%; height: 100%; display: block; }
.picker-cats {
    overflow-x: auto;
    border-top: 1px solid var(--line);
    margin-top: 4px;
    padding-top: 4px;
}
.picker-cats button {
    width: 40px;
    height: 36px;
    flex: none;
    border-radius: 10px;
    font-size: 1.15rem;
}

.sheet {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    align-items: end;
    justify-items: center;
}
.sheet[hidden] { display: none; }
.sheet-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(36, 28, 25, 0.35);
}
.sheet-card {
    position: relative;
    width: min(480px, 100%);
    margin: 0 auto;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    background: var(--paper-2);
    border-radius: 22px 22px 0 0;
    box-shadow: var(--shadow);
}
.dp-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 14px;
}
.self-avatar { width: 68px; height: 68px; font-size: 1.25rem; }
.dp-actions { display: flex; flex-direction: column; align-items: flex-start; }
.sheet-card .dp-change,
.sheet-card .dp-clear {
    position: relative;
    width: auto;
    display: inline-flex;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--rose-deep);
    font-weight: 600;
}
.dp-change input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.sheet-user {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.35rem;
}
.sheet-since { margin: 4px 0 14px; color: var(--muted); font-size: 0.9rem; }
.mood-label {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.mood-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}
.sheet-card .mood-picks button {
    width: auto;
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    font-size: 0.92rem;
}
.sheet-card .mood-picks button.is-on {
    background: var(--blush);
    border-color: transparent;
    color: var(--rose-deep);
    font-weight: 600;
}
.sheet-card button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 13px 8px;
    border-bottom: 1px solid var(--line);
    background: transparent;
}
.sheet-card .danger { color: var(--rose-deep); }
.sheet-card .text-btn { text-align: center; border: 0; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 48px 16px 16px;
    background: rgba(24, 16, 18, 0.92);
}
.lightbox[hidden] { display: none; }
.lightbox img {
    max-width: min(960px, 100%);
    max-height: calc(100dvh - 180px);
    border-radius: 12px;
}
.lightbox-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
    color: #fffaf7;
    padding: 8px 12px;
}

button.avatar { border: 0; padding: 0; flex-shrink: 0; }
.sheet-card button.self-avatar { width: 68px; padding: 0; border-radius: 50%; display: grid; background: var(--rose); color: #fffaf7; }
.memories { width: min(680px, calc(100% - 24px)); max-height: calc(100dvh - 40px); padding: 22px; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.memories::backdrop { background: rgba(24, 16, 18, .65); }
.memories-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.memories h2 { margin: 0; font-family: "Fraunces", serif; overflow-wrap: anywhere; }
.memories button, .album-upload { border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); padding: 9px 12px; cursor: pointer; }
.memories-header button { font-size: 24px; }
.memories .lightbox-close { background: transparent; color: #fffaf7; border-color: rgba(255, 250, 247, .3); }
.memories > p { color: var(--muted); font-size: .9rem; }
.album-create { display: flex; gap: 8px; margin-bottom: 16px; }
.album-create input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); padding: 10px; }
.album-create button { background: var(--rose); color: #fffaf7; }
.album-list, .album-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.album-card { display: flex; flex-direction: column; text-align: left; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.album-card img, .album-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.album-placeholder { display: grid; place-items: center; font-size: 48px; color: var(--rose); background: var(--blush); }
.album-card > span:last-child { font-size: 13px; color: var(--muted); }
.album-upload { display: inline-block; margin: 10px 0 0 6px; color: var(--rose-deep); }
.album-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.album-upload:focus-within { outline: 2px solid var(--rose); }
.memory-photo { min-width: 0; border-radius: 14px; background: var(--paper-2); overflow: hidden; }
.memories .memory-photo-view { display: block; border: 0; padding: 0; border-radius: 0; width: 100%; }
.memory-photo-view img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.memory-photo-reactions, .photo-reactions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 8px; }
.memory-photo-reactions button, .photo-reactions button { padding: 5px; border: 1px solid transparent; border-radius: 10px; background: transparent; font-size: 17px; }
.photo-reactions { background: var(--paper); border-radius: 18px; align-self: start; max-width: 100%; }
.photo-reactions button { color: var(--ink); font-size: 24px; padding: 8px; }
.memory-photo-reactions button[aria-pressed="true"], .photo-reactions button[aria-pressed="true"] { background: var(--blush); border-color: var(--rose); }
.reaction-particle { position: fixed; z-index: 100; pointer-events: none; font-size: 30px; }
.message-reactions button[aria-pressed="true"] { animation: reaction-pop .3s ease-out; }
@keyframes reaction-pop { 0% { transform: scale(.7); } 65% { transform: scale(1.2); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .message-reactions button[aria-pressed="true"] { animation: none; } }
@media (max-width: 400px) { .memories { padding: 14px; } .album-create { flex-wrap: wrap; } .album-create input { flex-basis: 100%; } .memory-photo-reactions { gap: 0; padding: 4px; } .memory-photo-reactions button { font-size: 15px; padding: 4px; } }

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 40;
    width: min(420px, calc(100% - 28px));
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--ink);
    color: #fffaf7;
    text-align: center;
    box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }

.call {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: #1a1214;
    color: #fffaf7;
    overflow: hidden;
}
.call[hidden] { display: none; }
.call-remote, .call-local {
    position: absolute;
    background: #1a1214;
}
.call-remote {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.call-local {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}
.call.is-live .call-local {
    inset: auto;
    top: auto;
    right: 16px;
    bottom: calc(118px + env(safe-area-inset-bottom));
    width: 112px;
    height: 168px;
    border-radius: 18px;
    border: 2px solid rgba(255, 250, 246, 0.72);
    z-index: 2;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}
.call-shade {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 22px 140px;
    text-align: center;
    pointer-events: none;
}
.call.is-incoming .call-shade {
    background:
        radial-gradient(520px 320px at 50% 30%, rgba(163, 61, 90, 0.45), transparent 70%),
        #241418;
}
.call.is-outgoing .call-shade,
.call.is-connecting .call-shade {
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(20, 12, 14, 0.72), transparent 46%);
}
.call.is-live .call-shade {
    inset: auto 0 auto 0;
    top: 0;
    padding: calc(18px + env(safe-area-inset-top)) 16px 28px;
    background: linear-gradient(to bottom, rgba(20, 12, 14, 0.55), transparent);
}
.call.is-live .call-shade .eyebrow { display: none; }
.call.is-live .call-shade h2 { font-size: 1.15rem; }
.call.is-live #call-status { margin-top: 2px; font-variant-numeric: tabular-nums; }
.call-shade .eyebrow { color: #f3c3ce; }
.call-shade h2 {
    margin: 0;
    color: #fffaf7;
    font-size: clamp(2rem, 7vw, 2.8rem);
}
#call-status { margin: 8px 0 0; color: rgba(255, 250, 246, 0.82); }
.call-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
}
.call-round {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 250, 246, 0.16);
    color: #fffaf7;
}
.call-round.danger { background: #a33d5a; }
.call-round.accept {
    width: auto;
    min-width: 118px;
    padding: 0 22px;
    border-radius: 999px;
    background: #2f7d54;
    font-weight: 600;
}
#call-decline {
    width: auto;
    min-width: 118px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 600;
}
.call-round.is-off { background: #fffaf7; color: #241c19; }
.call-round:hover { filter: brightness(1.06); }

@media (min-width: 860px) {
    body { display: grid; place-items: center; min-height: 100%; }
    .app {
        height: min(900px, calc(100dvh - 40px));
        border-radius: 28px;
        box-shadow: 0 30px 80px rgba(80, 40, 50, 0.16);
    }
    .sheet-card {
        border-radius: 22px;
        margin-bottom: 12vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
