/* S2-01j onboarding v5.1 — Caly, the side chat and the phone companion bar (side.css), ported from Roster design/calyvro-onboarding-v5 and scoped under .onb5. */
.onb5 .side { position: sticky; top: 108px; display: grid; gap: 18px; align-content: start; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2); padding: 20px; max-height: calc(100vh - 128px); }
/* Companion slot — fixed 1:1 container; the final animated asset drops in here.
   data-state hook: idle · thinking · finding · placing · celebrating. */
.onb5 .mate-slot { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); transition: all .4s var(--ease); }
.onb5 .mate { position: relative; width: 96px; aspect-ratio: 1; transition: width .5s var(--ease); }
.onb5 .mate__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 88%; filter: drop-shadow(0 10px 10px rgba(60, 44, 130, .16)); transition: opacity .35s var(--ease); animation: mate-breathe calc(3.4s / var(--spd)) ease-in-out infinite; }
.onb5 .mate__img--hold { opacity: 0; }
.onb5 .mate-slot[data-state="placing"] .mate__img--hold, .onb5 .mate-slot[data-state="celebrating"] .mate__img--hold { opacity: 1; }
.onb5 .mate-slot[data-state="placing"] .mate__img--idle, .onb5 .mate-slot[data-state="celebrating"] .mate__img--idle { opacity: 0; }
.onb5 .mate__bubble { position: absolute; right: -6px; top: 4px; display: flex; gap: 3px; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--surface); box-shadow: var(--sh-1), inset 0 0 0 1px var(--line); opacity: 0; transform: scale(.6); transition: all .3s var(--spring); }
.onb5 .mate__bubble i { width: 4px; height: 4px; border-radius: 50%; background: var(--violet); animation: mate-dots calc(1.2s / var(--spd)) infinite; }
.onb5 .mate__bubble i:nth-child(2) { animation-delay: .2s; }
.onb5 .mate__bubble i:nth-child(3) { animation-delay: .4s; }
.onb5 .mate__spark { position: absolute; right: 2px; top: 0; width: 22px; height: 22px; color: var(--violet); opacity: 0; }
.onb5 .mate__spark svg { width: 100%; height: 100%; fill: currentColor; }
.onb5 .mate__spark + .mate__spark { right: auto; left: 0; top: 26px; width: 12px; height: 12px; color: var(--t-lav); }
.onb5 .mate-slot[data-state="thinking"] .mate__bubble { opacity: 1; transform: none; }
.onb5 .mate-slot[data-state="thinking"] .mate__img { animation: mate-sway calc(2.4s / var(--spd)) ease-in-out infinite; }
.onb5 .mate-slot[data-state="finding"] .mate__img { animation: mate-hop calc(.6s / var(--spd)) var(--spring) 1; }
.onb5 .mate-slot[data-state="finding"] .mate__spark, .onb5 .mate-slot[data-state="celebrating"] .mate__spark { animation: mate-spark calc(1s / var(--spd)) var(--spring) both; }
.onb5 .mate-slot[data-state="celebrating"] .mate__spark { animation-iteration-count: 3; }
.onb5 .mate-slot[data-state="placing"] .mate__img { animation: mate-tilt calc(1.1s / var(--spd)) ease-in-out infinite; }
.onb5 .mate-slot[data-state="celebrating"] .mate__img { animation: mate-hop calc(.7s / var(--spd)) var(--spring) 3; }
@keyframes mate-breathe { 50% { transform: scale(1.015, .985); } }
@keyframes mate-sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes mate-dots { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@keyframes mate-spark { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 50% { transform: scale(1.15) rotate(10deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 0; } }
@keyframes mate-tilt { 50% { transform: rotate(-3deg) translateY(-3px); } }
@keyframes mate-hop { 40% { transform: translateY(-12px) scale(.98, 1.02); } 70% { transform: translateY(0) scale(1.03, .97); } 100% { transform: none; } }
.onb5[data-motion="reduced"] .mate * { animation: none !important; }
.onb5 .mate-slot__t { display: grid; gap: 4px; min-width: 0; }
.onb5 .mate-slot__name { font-weight: 700; font-size: 17px; letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; }
.onb5 .mate-slot__mood { font-size: 13.5px; color: var(--ink2); min-height: 1.4em; line-height: 1.4; }
.onb5 .mate-slot__mood[data-swap] { animation: cv-swap .32s var(--ease); }
.onb5 .shell[data-mate="off"] .mate { display: none; }
.onb5 .shell[data-mate="off"] .mate-slot { grid-template-columns: 1fr; }
/* the calendar: the side panel steps aside; Caly moves into the calendar header to deliver the posts */
.onb5 .shell[data-moment="cal"] { grid-template-columns: minmax(0, 1fr); }
.onb5 .shell[data-moment="cal"] .side, .onb5 .shell[data-moment="cal"] .peek { display: none !important; }
.onb5 .shell[data-moment="cal"] .main { width: 100%; max-width: 1360px; margin: 0 auto; }
.onb5 .mate-slot--cal { display: flex; align-items: center; gap: 6px; padding: 0; border: 0; }
.onb5 .mate-slot--cal .mate { width: 150px; flex: none; }
.onb5 .mate-slot--cal .mate__img--hold { opacity: 1; }
.onb5 .mate-slot--cal .mate__img--idle { opacity: 0; }
.onb5 .mate-slot--cal .mate-slot__t { position: relative; max-width: 260px; padding: 12px 16px; border-radius: 18px 18px 6px 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2); }
.onb5 .mate-slot--cal .mate-slot__mood { color: var(--ink); font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.onb5 .mate-slot--cal .mate__bubble { display: none; }
/* conversation */
.onb5 .chat { display: grid; gap: 12px; align-content: start; overflow-y: auto; scrollbar-width: none; max-height: calc(100vh - 330px); padding: 2px; }
.onb5 .chat::-webkit-scrollbar { display: none; }
.onb5 .msg { display: grid; gap: 10px; justify-items: start; }
.onb5 .msg__say { max-width: 94%; padding: 12px 16px; border-radius: 18px 18px 18px 6px; background: var(--sunk); font-size: 14px; line-height: 1.45; font-weight: 500; letter-spacing: -.01em; }
.onb5 .msg__opt { display: flex; gap: 6px; flex-wrap: wrap; }
.onb5 .msg__opt .btn { height: 36px; padding: 0 14px; font-size: 13px; white-space: normal; text-align: left; line-height: 1.25; min-height: 36px; height: auto; padding-top: 8px; padding-bottom: 8px; }
.onb5 .msg[data-done] .msg__opt, .onb5 .msg[data-done] .multi, .onb5 .msg[data-done] .msg__skip { display: none; }
.onb5 .msg[data-done] .msg__say { color: var(--ink2); font-weight: 400; font-size: 13px; padding: 10px 14px; }
.onb5 .receipt { justify-self: end; display: flex; align-items: center; gap: 8px; max-width: 90%; font-size: 13px; color: #fff; padding: 9px 14px; border-radius: 18px 18px 6px 18px; background: var(--ink); line-height: 1.35; }
.onb5 .receipt .cv-i { width: 13px; height: 13px; stroke-width: 2.2; color: #fff; opacity: .7; }
.onb5 .receipt b { font-weight: 600; }
.onb5 .receipt__arrow { display: none; }
.onb5 .multi { display: flex; gap: 6px; flex-wrap: wrap; }
.onb5 .multi .chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .2s var(--ease); }
.onb5 .multi .chip:hover { border-color: rgba(20, 20, 32, .25); }
.onb5 .multi .chip[data-on] { background: var(--ink); color: #fff; border-color: var(--ink); }
.onb5 .multi__go { width: 100%; display: flex; gap: 8px; margin-top: 4px; }
.onb5 .msg__skip { font-size: 12px; color: var(--ink3); background: none; border: 0; padding: 0 4px; text-align: left; }
.onb5 .msg__skip:hover { color: var(--ink2); }
.onb5 .chat__quiet { justify-self: center; font-size: 12px; color: var(--ink3); display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.onb5 .chat__quiet::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 3px var(--halo); }
/* phone companion bar: slim, light, never covers the stage */
.onb5 .peek { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 10px 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--sh-3); font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; text-align: left; transition: transform .4s var(--ease), opacity .3s; }
.onb5 .peek__av { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--sunk); overflow: hidden; flex: none; }
.onb5 .peek__av img { position: absolute; left: -9px; top: -4px; width: 62px; height: 62px; max-width: none; object-fit: contain; }
.onb5 .peek__txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.onb5 .peek__name { font-size: 11.5px; font-weight: 500; color: var(--ink3); display: flex; align-items: center; gap: 6px; }
.onb5 .peek__name::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); }
.onb5 .peek__line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onb5 .peek__open { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.onb5 .peek__open .cv-i { width: 15px; height: 15px; transform: rotate(-90deg); }
.onb5 .peek[data-attn] .peek__av { animation: cv-pop .5s var(--spring); }
@keyframes cv-pop { 50% { transform: scale(1.12); } }
.onb5 .side__close { display: none; }
@media (max-width: 900px) {
  .onb5 .side { display: none; }
/* opened: a compact card above the bar — only the live question and the last answer, max ~half the screen */
  .onb5 .shell[data-side="open"] .side { display: grid; position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); top: auto; z-index: 70; border-radius: 26px; max-height: 54vh; padding: 14px 14px 16px; gap: 12px; box-shadow: 0 -2px 8px rgba(16, 16, 28, .04), 0 30px 80px -20px rgba(16, 16, 28, .38); animation: side-up .42s var(--ease); }
  .onb5 .shell[data-side="open"] .peek { opacity: 0; transform: translateY(20px); pointer-events: none; }
  .onb5 .shell[data-side="open"] .mate-slot { grid-template-columns: 48px 1fr; gap: 12px; padding: 0 44px 12px 0; }
  .onb5 .shell[data-side="open"] .mate { width: 48px; }
  .onb5 .shell[data-side="open"] .mate__bubble, .onb5 .shell[data-side="open"] .mate__spark { display: none; }
  .onb5 .shell[data-side="open"] .mate-slot__name { font-size: 15px; }
  .onb5 .shell[data-side="open"] .mate-slot__mood { font-size: 12.5px; }
  .onb5 .side__close { display: grid; position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; background: var(--sunk); }
  .onb5 .chat { max-height: calc(54vh - 110px); }
  .onb5 .chat > *:not(:nth-last-child(-n+2)) { display: none; }
@keyframes side-up { from { transform: translateY(30px); opacity: 0; } }
}
@media (min-width: 901px) {
  .onb5 .peek, .onb5 .side__close { display: none !important; }
}
