/* ────────────────────────────────────────────────────────────────────────
   Couple co-presence ("Zajedno") — partner chip + poke + toast.
   Layer 1 draft (dalia-design). Ambient delight: ONE quiet lilac/mauve touch,
   not a lead surface. Partner↔partner only. Tokens from dalia-portal.css
   (loaded before this file in shell_couple.html) — no raw hex, no literal easing.
   ──────────────────────────────────────────────────────────────────────── */

/* ── chip (shared) ── */
/* No border — Rasmus: chip je nit, ne kartica. Samo paper-2 wash. */
.cp-presence {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 10px 5px 6px;
    border-radius: 999px;
    background: var(--paper-2);
    font-family: var(--font-body);
    line-height: 1.1;
    max-width: 100%;
    box-sizing: border-box;          /* padding ne gura srce preko ruba */
}
.cp-presence__avatar {
    width: 24px; height: 24px; border-radius: 50%;
    flex-shrink: 0; object-fit: cover;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--lilac-200);
    color: var(--ink);
    font-size: 11px; font-weight: 600;
}
/* flex:1 + min-width:0 → ime/sekcija se skraćuju (…), srce uvijek stane (ne reže se) */
.cp-presence__meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cp-presence__name {
    font-size: 12px; font-weight: 600; color: var(--ink);
    display: inline-flex; align-items: center; gap: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-presence__where {
    font-size: 10px; color: var(--ink-soft);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px;
}
.cp-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    background: var(--ink-faint);   /* offline default */
}
.cp-presence.is-online .cp-dot { background: var(--color-deep-mauve); }

/* poke button — heart, quiet until hover */
.cp-poke-btn {
    margin-left: 2px; flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 50%;
    border: none; background: transparent; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-faint);
    transition: color .2s var(--ease), background .2s var(--ease);
}
.cp-poke-btn:hover { color: var(--color-deep-mauve); background: var(--lilac-100); }
.cp-poke-btn:disabled { opacity: .5; cursor: default; }
.cp-poke-btn svg { width: 16px; height: 16px; }
.cp-poke-btn.is-popping svg { animation: zd-heart-pop 0.55s var(--ease); }

/* ── desktop placement — under the sidebar header ── */
/* Born only when the partner appears → gentle entrance, no announcement. */
.cp-presence--desktop { display: flex; margin: 10px 0 2px; width: 100%; animation: dpFadeUp .45s var(--ease) both; }
@media (max-width: 768px) { .cp-presence--desktop { display: none; } }

/* ── mobile placement — single 44px tap target in the topbar ──
   Rasmus (c/d): avatar+dot only (no inline heart = no fat-finger), tap → popover
   carries the section + a 44px heart. The "where" lives one layer deeper. */
.cp-presence--mobile {
    padding: 0; gap: 0; border: none; background: transparent; cursor: pointer;
    margin-right: 4px;
    width: 44px; height: 44px; border-radius: 50%;
    justify-content: center;
    animation: dpFadeUp .45s var(--ease) both;
}
.cp-presence--mobile .cp-presence__meta { display: none; }
.cp-presence--mobile .cp-presence__avatar { position: relative; width: 30px; height: 30px; }
.cp-presence--mobile .cp-dot {
    position: absolute; bottom: -1px; right: -1px;
    border: 1.5px solid var(--paper);
    width: 9px; height: 9px;
}
@media (min-width: 769px) { .cp-presence--mobile { display: none; } }

/* mobile popover (tap the avatar) — section + 44px heart */
.cp-mpanel {
    position: fixed; top: 56px; right: 10px; z-index: var(--z-toast, 1200);
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px 8px 12px; border-radius: 16px;
    background: var(--paper); border: 1px solid var(--lilac-300);
    box-shadow: var(--shadow); font-family: var(--font-body);
    opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.cp-mpanel.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cp-mpanel__meta { display: flex; flex-direction: column; min-width: 0; }
.cp-mpanel__name { font-size: 13px; font-weight: 600; color: var(--ink); }
.cp-mpanel__where { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.cp-mpanel .cp-dot { background: var(--ink-faint); }
.cp-mpanel.is-online .cp-dot { background: var(--color-deep-mauve); }
.cp-mpanel .cp-poke-btn { width: 44px; height: 44px; }
.cp-mpanel .cp-poke-btn svg { width: 20px; height: 20px; }
@media (min-width: 769px) { .cp-mpanel { display: none; } }
@media (prefers-reduced-motion: reduce) { .cp-mpanel { transition: opacity .15s linear; } }

/* ── love-note chip (T2) — born when unread notes exist (💌) ── */
.cp-note {
    display: inline-flex; align-items: center; gap: 7px;
    border: none; cursor: pointer; box-sizing: border-box;
    background: var(--paper-2); border-radius: 999px;
    font-family: var(--font-body);
    animation: dpFadeUp .45s var(--ease) both;
}
.cp-note__glyph { font-size: 15px; line-height: 1; flex-shrink: 0; }
.cp-note__label {
    font-size: 12px; font-weight: 600; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cp-note--desktop { width: 100%; margin: 8px 0 2px; padding: 6px 12px; }
@media (max-width: 768px) { .cp-note--desktop { display: none; } }
.cp-note--mobile {
    width: 44px; height: 44px; justify-content: center;
    background: transparent; margin-right: 2px;
}
.cp-note--mobile .cp-note__glyph { font-size: 18px; }
@media (min-width: 769px) { .cp-note--mobile { display: none; } }

/* note panel (tap the 💌 chip) */
.cp-npanel {
    position: fixed; top: 56px; right: 10px; z-index: var(--z-toast, 1200);
    width: min(300px, calc(100vw - 28px));
    background: var(--paper); border: 1px solid var(--lilac-300);
    border-radius: 16px; box-shadow: var(--shadow);
    padding: 12px 14px; font-family: var(--font-body);
    opacity: 0; transform: translateY(-6px); pointer-events: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.cp-npanel.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cp-npanel__head { font-size: 11px; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 8px; }
.cp-npanel__note {
    display: flex; gap: 8px; align-items: flex-start;
    font-size: 14px; color: var(--ink); line-height: 1.45;
    padding: 6px 0; border-top: 1px solid var(--ivory);
}
.cp-npanel__note:first-of-type { border-top: none; }
.cp-npanel__st { font-size: 18px; line-height: 1.2; flex-shrink: 0; }
.cp-npanel__ok {
    margin-top: 10px; width: 100%; padding: 9px; border-radius: 10px; cursor: pointer;
    background: transparent; color: var(--color-deep-mauve); border: 1px solid var(--lilac-300);
    font-family: var(--font-body); font-size: 13px; font-weight: 600;
}
.cp-npanel__ok:hover { background: var(--lilac-100); }
@media (min-width: 769px) { .cp-npanel { right: auto; left: 250px; top: 80px; } }
@media (prefers-reduced-motion: reduce) {
    .cp-note { animation: none; }
    .cp-npanel { transition: opacity .15s linear; }
}

/* compose stickers + message (settings → Partner card) */
.ln-st {
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
    border: 1px solid var(--ivory); background: var(--paper);
    font-size: 16px; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .15s var(--ease), transform .15s var(--ease);
}
.ln-st:hover { transform: scale(1.08); }
.ln-st.is-sel { border-color: var(--color-deep-mauve); background: var(--lilac-100); }
.ln-msg.ln-err { color: var(--rose-500); }

/* ── poke toast (incoming) ── */
.cp-toast {
    position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(12px);
    z-index: var(--z-toast, 1200);
    display: inline-flex; align-items: center; gap: 9px;
    padding: 11px 16px; border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--lilac-300);
    box-shadow: var(--shadow);
    font-family: var(--font-body); font-size: 13px; color: var(--ink);
    opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.cp-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cp-toast__glyph { font-size: 18px; line-height: 1; }
.cp-toast.is-show .cp-toast__glyph { animation: zd-heart-pop 0.6s var(--ease); }

@media (prefers-reduced-motion: reduce) {
    .cp-presence--desktop, .cp-presence--mobile,
    .cp-poke-btn.is-popping svg,
    .cp-toast.is-show .cp-toast__glyph { animation: none; }
    .cp-toast { transition: opacity .2s linear; }
}
