/* Memories page — "memory sky" design.
   Palette mirrors the app: ink #17191f, muted #5e6778, accent #2f7fa7. */

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

:root {
    --ink: #17191f;
    --muted: #5e6778;
    --quiet: #8690a2;
    --line: rgba(184, 188, 198, 0.72);
    --accent: #2f7fa7;
    --accent-strong: #1d5f83;
    --accent-soft: rgba(47, 127, 167, 0.10);
    --error: #d94b4b;
    --page-bg: #f3f6fa;
}

html { background: var(--page-bg); }

body {
    font-family: 'Kumbh Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 500px at 85% -100px, rgba(255, 214, 150, 0.16), transparent 65%),
        radial-gradient(1000px 600px at 5% -50px, rgba(120, 180, 230, 0.18), transparent 60%),
        var(--page-bg);
    min-height: 100vh;
}

.hidden { display: none !important; }

/* ---------- Header ---------- */

.memories-header {
    position: sticky;
    top: 0;
    z-index: 40;
    /* No backdrop-filter: on older Android GPUs (Huawei WebView etc.) a
       blurred sticky header recomposites every scrolled frame and makes the
       whole page feel sticky/janky. Near-opaque white reads the same. */
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(184, 188, 198, 0.35);
}

.header-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo img { height: 34px; display: block; }

.header-auth { display: flex; align-items: center; gap: 12px; }

.login-btn {
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    padding: 8px 16px;
    border-radius: 999px;
}

.user-info { display: flex; align-items: center; gap: 8px; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #dde5ee; }
.user-name { font-size: 13.5px; font-weight: 600; color: var(--muted); }

/* ---------- Layout ---------- */

.memories-main { padding: 26px 16px 60px; }

.memories-container {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.memories-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px;
}

.memories-title-row h1 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.memories-subtitle { color: var(--muted); font-size: 14.5px; margin-top: 3px; }

.count-pill {
    flex-shrink: 0;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 6px 12px;
    margin-bottom: 4px;
}

/* ---------- Character picker ---------- */

.char-picker {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 4px 6px;
    scrollbar-width: none;
}
.char-picker::-webkit-scrollbar { display: none; }

.char-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(30, 50, 80, 0.07);
    cursor: pointer;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--muted);
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.char-chip:hover { transform: translateY(-1px); }

.char-chip.active {
    border-color: var(--accent);
    color: var(--accent-strong);
    background: #fff;
}

.char-chip img,
.char-chip .char-chip-fallback {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    background: #e6edf5;
}

.char-chip .char-chip-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-strong);
    background: var(--accent-soft);
}

/* ---------- Panels ---------- */

.panel {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(184, 188, 198, 0.4);
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(30, 50, 80, 0.08);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.soft-panel { align-items: center; }

.loading-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
    padding: 26px 0;
}

.spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(47, 127, 167, 0.25);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.logged-out-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 26px 10px;
}

.logged-out-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(160deg, #d9edfc, #fdf0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 22px;
}

.logged-out-inner h2 { font-size: 19px; font-weight: 800; }
.logged-out-inner p { color: var(--muted); font-size: 14px; }

.primary-btn {
    margin-top: 6px;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 14.5px;
    padding: 10px 26px;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(47, 127, 167, 0.35);
}

/* ---------- Memory sky ---------- */

.sky-panel {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    min-height: 230px;
    background: linear-gradient(180deg, #cfe8fa 0%, #e7f3fd 55%, #fdf1e3 100%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sky-sun {
    position: absolute;
    top: -60px;
    right: -40px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 223, 166, 0.55) 0%, rgba(255, 223, 166, 0) 70%);
    pointer-events: none;
}

.sky-cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 999px;
    filter: blur(1px);
    pointer-events: none;
    animation: cloud-drift 14s ease-in-out infinite;
}

.sky-cloud::before,
.sky-cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.sky-cloud-1 { width: 84px; height: 26px; top: 26px; left: 8%; }
.sky-cloud-1::before { width: 34px; height: 34px; top: -16px; left: 14px; }
.sky-cloud-1::after  { width: 24px; height: 24px; top: -10px; left: 44px; }

.sky-cloud-2 { width: 64px; height: 20px; top: 48%; right: 6%; opacity: 0.7; animation-delay: -5s; }
.sky-cloud-2::before { width: 26px; height: 26px; top: -12px; left: 10px; }
.sky-cloud-2::after  { width: 18px; height: 18px; top: -8px; left: 34px; }

.sky-cloud-3 { width: 74px; height: 22px; bottom: 22px; left: 16%; opacity: 0.8; animation-delay: -9s; }
.sky-cloud-3::before { width: 30px; height: 30px; top: -14px; left: 12px; }
.sky-cloud-3::after  { width: 20px; height: 20px; top: -9px; left: 40px; }

.sky-cloud-4 { width: 56px; height: 18px; top: 14px; right: 24%; opacity: 0.55; animation-delay: -3s; }
.sky-cloud-4::before { width: 22px; height: 22px; top: -10px; left: 9px; }
.sky-cloud-4::after  { width: 15px; height: 15px; top: -7px; left: 30px; }

@keyframes cloud-drift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(18px); }
}

.bubble-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 20px 16px;
}

.memory-bubble {
    max-width: min(78%, 380px);
    display: flex;
    flex-direction: column;
    animation: bubble-bob 5.5s ease-in-out infinite;
}

.memory-bubble:nth-child(odd) { align-self: flex-start; align-items: flex-end; }
.memory-bubble:nth-child(even) { align-self: flex-end; align-items: flex-start; }

.memory-bubble:nth-child(2) { animation-delay: -1.4s; }
.memory-bubble:nth-child(3) { animation-delay: -2.8s; }
.memory-bubble:nth-child(4) { animation-delay: -4.2s; }
.memory-bubble:nth-child(5) { animation-delay: -1.9s; }
.memory-bubble:nth-child(6) { animation-delay: -3.4s; }

@keyframes bubble-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.memory-bubble .bubble-body {
    background: var(--bubble-fill, #ffffff);
    border: 1px solid var(--bubble-edge, #d3e3f2);
    border-radius: 18px;
    padding: 10px 14px;
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--ink);
    box-shadow: 0 4px 12px rgba(30, 50, 80, 0.1);
}

.memory-bubble .bubble-tail {
    display: flex;
    gap: 3px;
    align-items: center;
    padding: 3px 18px 0;
}

.memory-bubble .bubble-tail i {
    display: block;
    border-radius: 50%;
    background: var(--bubble-fill, #ffffff);
    border: 1px solid var(--bubble-edge, #d3e3f2);
}

.memory-bubble .bubble-tail i:first-child { width: 8px; height: 8px; }
.memory-bubble .bubble-tail i:last-child { width: 5px; height: 5px; }

.memory-bubble.tint-0 { --bubble-fill: #ffffff; --bubble-edge: #d3e3f2; }
.memory-bubble.tint-1 { --bubble-fill: #fff6ea; --bubble-edge: #efdcc0; }
.memory-bubble.tint-2 { --bubble-fill: #f0f7ff; --bubble-edge: #c8ddf4; }
.memory-bubble.tint-3 { --bubble-fill: #f6f1ff; --bubble-edge: #dbceef; }

.sky-caption {
    position: relative;
    align-self: center;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 16px 16px;
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    color: var(--accent-strong);
    font-size: 12px;
    font-weight: 700;
}

.sky-caption i { font-size: 11px; }

/* ---------- Status line + chips ---------- */

.status-line { display: flex; gap: 11px; align-items: flex-start; }

.status-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.status-title { font-size: 15px; font-weight: 700; }
.status-detail { font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; }

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

.hint-chips-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--quiet);
}

.hint-chips-row { display: flex; flex-wrap: wrap; gap: 7px; }

.hint-chip {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 7px 12px;
}

/* ---------- Fact groups ---------- */

.fact-groups { display: flex; flex-direction: column; gap: 12px; }

.fact-group {
    border: 1px solid rgba(184, 188, 198, 0.35);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fact-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--quiet);
}

.fact-group-title i { color: var(--accent); font-size: 12px; }

.fact-item {
    display: flex;
    gap: 9px;
    align-items: baseline;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
}

/* Who a memory is ABOUT — the companion it concerns. A pill rather than bold
   text alone: these lines sit in a list of ordinary facts about the user, and
   the name is the one thing that says this one is about somebody else. */
.fact-about {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(143, 118, 240, 0.14);
    color: #6f5fd0;
    align-self: center;
}

.fact-item::before {
    content: '';
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(140deg, #8ec3e6, #f2c894);
    position: relative;
    top: -1px;
}

/* ---------- Panel actions / buttons ---------- */

.panel-actions { display: flex; justify-content: flex-end; }

.panel-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.panel-heading {
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--quiet);
}

.panel-heading-actions { display: flex; align-items: center; gap: 6px; }

.ghost-btn,
.danger-link {
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ghost-btn { color: var(--accent-strong); }
.ghost-btn:hover { background: var(--accent-soft); }

.danger-link { color: var(--error); }
.danger-link:hover { background: rgba(217, 75, 75, 0.08); }

.danger-btn {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 9px 20px;
    color: #fff;
    background: var(--error);
}

/* ---------- Conversations ---------- */

.session-list { display: flex; flex-direction: column; gap: 10px; }

.session-card {
    border: 1px solid rgba(184, 188, 198, 0.35);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.session-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.session-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.session-info { flex: 1; min-width: 0; }

.session-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-preview {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.session-meta { font-size: 11.5px; color: var(--quiet); margin-top: 3px; }

.session-chevron { color: var(--quiet); font-size: 12px; transition: transform 0.2s ease; }
.session-card.open .session-chevron { transform: rotate(180deg); }

.session-thread {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 4px 14px 14px;
}

.session-card.open .session-thread { display: flex; }

.thread-msg { display: flex; flex-direction: column; max-width: 86%; }
.thread-msg.role-user { align-self: flex-end; align-items: flex-end; }
.thread-msg.role-assistant { align-self: flex-start; align-items: flex-start; }

.thread-msg .msg-body {
    font-size: 13.5px;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.thread-msg.role-user .msg-body {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.thread-msg.role-assistant .msg-body {
    background: #eef2f7;
    color: var(--ink);
    border-bottom-left-radius: 5px;
}

.thread-msg .msg-time { font-size: 10.5px; color: var(--quiet); margin-top: 3px; padding: 0 4px; }

.sessions-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13.5px;
    padding: 10px 4px;
}

.sessions-empty i { color: var(--quiet); }

/* ---------- Confirm dialog ---------- */

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(23, 25, 31, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(20, 30, 50, 0.3);
}

.confirm-card h3 { font-size: 17px; font-weight: 800; }
.confirm-card p { font-size: 13.5px; color: var(--muted); line-height: 1.45; margin-top: 8px; }

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
    .memories-title-row h1 { font-size: 25px; }
    .panel { padding: 13px; border-radius: 20px; }
    .memory-bubble { max-width: 86%; }
}

@media (prefers-reduced-motion: reduce) {
    .sky-cloud, .memory-bubble { animation: none; }
}

/* ---------- Embedded (app WebView) mode ---------- */

:root.embed .memories-header { display: none; }
:root.embed .memories-main { padding-top: 16px; }

/* The app's own top bar already says "Memories", so the page heading would be
   the same word twice. The subtitle becomes the lead line; the count pill keeps
   its place beside it. */
:root.embed .memories-title-row h1 { display: none; }
:root.embed .memories-subtitle { margin-top: 0; font-size: 15px; }
:root.embed .memories-title-row { align-items: center; }

/* ---------- Highlights-first restructure (v2) ---------- */

/* Full fact list lives behind this expander — the sky carries the page. */
.facts-toggle {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--accent-strong);
    border: none;
    background: var(--accent-soft);
    cursor: pointer;
    border-radius: 999px;
    padding: 9px 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: center;
    margin: 2px auto 0;
    transition: filter 0.15s ease;
}
.facts-toggle:hover { filter: brightness(0.97); }
.facts-toggle i { transition: transform 0.2s ease; font-size: 12px; }
.facts-toggle.open i { transform: rotate(180deg); }

.facts-detail { display: flex; flex-direction: column; gap: 14px; }

.sessions-more { align-self: center; margin-top: 2px; }

/* Everyone view: shared facts can be forgotten one line at a time. */
.fact-item.removable { align-items: center; }
.fact-item.removable > .fact-remove { margin-left: auto; }
.fact-remove {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    /* Thumb-sized hit area (the icon stays small); 26px missed on phones. */
    width: 40px;
    height: 40px;
    margin: -7px 0;
    border-radius: 50%;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.fact-remove:hover {
    opacity: 1;
    color: var(--error);
    background: rgba(217, 75, 75, 0.08);
}

/* Phones: every control gets a full thumb-sized padding. */
@media (pointer: coarse) {
    .ghost-btn, .danger-link { padding: 11px 14px; }
    .facts-toggle { padding: 12px 18px; }
    .session-head { min-height: 52px; }
}


/* ---------- Relationship-first character view ---------- */

.story-block { display: flex; flex-direction: column; gap: 12px; }

.story-item {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(184, 188, 198, 0.4);
    border-radius: 16px;
    padding: 12px 14px;
}

.story-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 12px; font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}
.story-label i { color: var(--accent); font-size: 11px; }

.story-text { font-size: 13.5px; line-height: 1.55; color: var(--ink); font-style: italic; }

.story-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.story-list li {
    font-size: 13.5px; line-height: 1.5; color: var(--ink);
    padding-left: 14px; position: relative;
}
.story-list li::before {
    content: ''; position: absolute; left: 0; top: 8px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); opacity: 0.55;
}

.photo-strip {
    display: block;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(184, 188, 198, 0.4);
    border-radius: 16px;
    padding: 12px 14px;
}
.photo-strip-row { display: flex; gap: 8px; align-items: center; }
.photo-strip-row img {
    width: 52px; height: 52px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(30, 50, 80, 0.12);
}
.photo-strip-more {
    font-size: 12.5px; font-weight: 800; color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 10px;
    width: 52px; height: 52px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- The character inside their own memory sky ---------- */

.sky-companions {
    position: absolute;
    left: 16px; bottom: 4px;
    display: flex; align-items: flex-end; gap: 10px;
    pointer-events: none;
}

.sky-companion { display: flex; flex-direction: column; align-items: center; }

.sky-sprite {
    background-repeat: no-repeat;
    animation-name: sprite-play;
    animation-iteration-count: infinite;
    filter: drop-shadow(0 4px 6px rgba(30, 50, 80, 0.18));
}
@keyframes sprite-play { to { background-position-x: var(--strip-shift); } }

/* thought dots drifting up from their head toward the memory clouds */
.thought-trail { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-bottom: 2px; }
.thought-trail i {
    display: block; border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(184, 200, 220, 0.8);
    animation: thought-float 3.2s ease-in-out infinite;
}
.thought-trail i:nth-child(1) { width: 9px; height: 9px; animation-delay: 0s; }
.thought-trail i:nth-child(2) { width: 6px; height: 6px; animation-delay: 0.4s; }
.thought-trail i:nth-child(3) { width: 4px; height: 4px; animation-delay: 0.8s; }
@keyframes thought-float {
    0%, 100% { transform: translateY(0); opacity: 0.9; }
    50% { transform: translateY(-3px); opacity: 0.55; }
}

/* keep the lowest bubble clear of the companions */
.sky-panel.with-companion .bubble-field { padding-bottom: 92px; }

@media (prefers-reduced-motion: reduce) {
    .sky-sprite, .thought-trail i { animation: none; }
}

/* ---------- Themes ---------- */

.theme-strip { display: flex; flex-direction: column; gap: 8px; }
.theme-strip-row { display: flex; flex-wrap: wrap; gap: 7px; }

.theme-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 7px 12px;
}
.theme-chip em { font-style: normal; font-weight: 800; opacity: 0.6; font-size: 11px; }

/* ---------- Conversation recap cards ---------- */

.sessions-hint { font-size: 12.5px; color: var(--quiet); margin: -2px 0 2px; }

.recap-card { position: relative; transition: border-color 0.18s ease, background 0.18s ease; }
.recap-card .session-head { padding-right: 40px; align-items: flex-start; }
.recap-card .session-title { white-space: normal; }
.recap-card .session-preview { white-space: normal; }

.recap-card.active {
    border-color: rgba(47, 127, 167, 0.55);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 14px rgba(47, 127, 167, 0.14);
}

/* Sentiment reads as a quiet tint on the icon, never a label. */
.session-icon.mood-positive { background: rgba(86, 170, 120, 0.14); color: #3f8d5f; }
.session-icon.mood-negative { background: rgba(217, 75, 75, 0.12); color: var(--error); }

.session-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.session-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    background: rgba(134, 144, 162, 0.13);
    border-radius: 999px;
    padding: 4px 9px;
}

.recap-forget {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--quiet);
    background: rgba(134, 144, 162, 0.12);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.recap-card:hover .recap-forget,
.recap-card.active .recap-forget { opacity: 1; }
.recap-forget:hover { color: var(--error); background: rgba(217, 75, 75, 0.12); }

/* Touch devices have no hover, so the control is always reachable. */
@media (hover: none) {
    .recap-forget { opacity: 1; }
}

/* ---------- Tell her something ---------- */

.tell-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(184, 188, 198, 0.45);
    border-radius: 999px;
    padding: 5px 5px 5px 16px;
}

.tell-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--ink);
    padding: 9px 0;
}
.tell-input::placeholder { color: var(--quiet); }

.tell-send {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}
.tell-send:hover { transform: scale(1.06); background: var(--accent-strong); }

.tell-status { font-size: 12.5px; color: var(--muted); padding: 0 6px; }
.tell-status.tone-good { color: var(--accent-strong); font-weight: 600; }
.tell-status.tone-bad { color: var(--error); }

/* Your own bubbles read as yours: accent fill, mirrored side, no bob — they're
   things you just said, not memories drifting in the sky. */
.memory-bubble.said-you,
.memory-bubble.said-them { animation: none; }

.memory-bubble.said-you { align-self: flex-end; align-items: flex-start; }
.memory-bubble.said-you .bubble-body {
    background: var(--accent);
    color: #fff;
}
.memory-bubble.said-you .bubble-tail i { background: var(--accent); }

.memory-bubble.said-them { align-self: flex-start; align-items: flex-end; }

.memory-bubble.said-pending .bubble-body {
    color: var(--quiet);
    animation: said-thinking 1.1s ease-in-out infinite;
}

@keyframes said-thinking {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 1; }
}
