/* The night before Siby: a phone with the team's group chat, and the button that makes it stop. */
.pain { display: grid; justify-items: center; gap: 22px; }
.pain-phone { transform: rotate(2deg); transition: transform 420ms var(--ease-spring); }
.pain-buzz { animation: pain-buzz 300ms linear; }
@keyframes pain-buzz { 0%, 100% { transform: rotate(2deg); } 20% { transform: rotate(2deg) translateX(-5px); } 40% { transform: rotate(2.6deg) translateX(5px); } 60% { transform: rotate(1.4deg) translateX(-4px); } 80% { transform: rotate(2deg) translateX(3px); } }
.pain-screen { gap: 0; padding-bottom: 0; }

.pain-head { display: flex; align-items: center; gap: 10px; padding: 6px 14px 12px; border-bottom: 1px solid var(--line); }
.pain-head .av { width: 34px; height: 34px; border-radius: 50%; font-size: 14px; }
.pain-head > span:not(.pain-unread) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pain-head b { font: 600 15px/20px var(--sans); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pain-head span span { font: 400 12px/16px var(--sans); color: var(--text-2); }
.pain-unread { flex: none; min-width: 26px; height: 26px; padding-inline: 8px; border-radius: 13px; display: inline-grid; place-items: center; background: var(--bad-solid); color: var(--on-navy); font: 700 13px/1 var(--mono); }
.pain-unread[hidden] { display: none; }
.pain-bump { animation: pain-bump 380ms var(--ease-spring); }
@keyframes pain-bump { 40% { transform: scale(1.5); } }

/* The newest message sits at the bottom; older ones are pushed up and out. */
.pain-chat { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px 12px 8px; }
.pain-msg { display: flex; align-items: flex-end; gap: 7px; }
.pain-msg .av { width: 26px; height: 26px; border-radius: 50%; }
.pain-bubble { display: flex; flex-direction: column; max-width: 218px; padding: 7px 11px 6px; border-radius: 16px 16px 16px 5px; background: var(--raised); border: 1px solid var(--line); }
[dir='rtl'] .pain-bubble { border-radius: 16px 16px 5px 16px; }
.pain-bubble b { font: 600 12px/16px var(--sans); color: var(--accent-text); }
.pain-bubble span { font: 400 14px/19px var(--sans); color: var(--text); }
.pain-bubble time { align-self: flex-end; font: 400 10px/13px var(--mono); color: var(--text-3); }
.pain-new { animation: pain-new 380ms var(--ease-spring) both; transform-origin: 0 100%; }
[dir='rtl'] .pain-new { transform-origin: 100% 100%; }
@keyframes pain-new { from { opacity: 0; transform: translateY(18px) scale(0.7); } }

.pain-typing { display: flex; align-items: center; gap: 4px; padding: 0 16px 8px; font: 400 12px/16px var(--sans); color: var(--text-2); }
.pain-typing[hidden] { display: none; }
.pain-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-2); animation: pain-dot 1.1s var(--ease-in-out) infinite; }
.pain-typing i:nth-child(2) { animation-delay: 160ms; } .pain-typing i:nth-child(3) { animation-delay: 320ms; }
.pain-typing span { margin-inline-start: 5px; }
@keyframes pain-dot { 0%, 100% { transform: none; opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }
.pain-type { flex: none; margin: 0 12px 14px; height: 40px; padding-inline: 16px; display: flex; align-items: center; border-radius: 20px; background: var(--sunken); border: 1px solid var(--line); font: 400 14px/1 var(--sans); color: var(--text-3); }

/* It stops: the messages fly off, and Siby's own rows take their place. */
.pain-out .pain-msg { animation: pain-off 420ms var(--ease-in-out) both; }
.pain-out .pain-msg:nth-child(even) { animation-name: pain-off-b; animation-delay: 60ms; }
.pain-out .pain-typing, .pain-out .pain-type, .pain-out .pain-head { transition: opacity 300ms linear; opacity: 0; }
@keyframes pain-off { to { opacity: 0; transform: translateX(-130%) rotate(-12deg); } }
@keyframes pain-off-b { to { opacity: 0; transform: translateX(130%) rotate(10deg); } }
.pain-calm { gap: 10px; padding-bottom: 14px; }
.pain-calm .ui-row { min-height: 0; padding: 7px 12px; }
.pain-calm .ui-row b { font-size: 13px; line-height: 18px; }
.pain-calm .ui-badge { font-style: normal; }
/* Spanish names and tasks run longer ("Clínica del Parque", "Temperatura del refrigerador de medicamentos"): the name
   stays on one line and the rows sit a little closer, so the eighth row still shows above the button. */
:lang(es) .pain-calm .ui-title { font-size: 20px; line-height: 23px; }
:lang(es) .pain-calm .ui-row { padding-block: 6px; }
.pain-zero { animation: pain-row 460ms var(--ease-spring) both; }
.pain-row { animation: pain-row 420ms var(--ease-spring) both; }
@keyframes pain-row { from { opacity: 0; transform: translateY(14px) scale(0.92); } }
.pain-phone:has(.pain-calm) { transform: rotate(-1.5deg); }

/* The button sits on the phone's lower edge, like a hand over the screen. */
.pain-act { position: relative; z-index: 2; display: grid; justify-items: center; gap: 12px; min-height: 110px; margin-top: -68px; }
.pain-stop { min-height: 60px; padding-inline: 34px; border-radius: 18px; font-size: 19px; border: 0; cursor: pointer; box-shadow: 0 18px 36px -14px color-mix(in oklab, var(--navy) 70%, transparent); }
.pain-stop.pain-quiet { min-height: 44px; padding-inline: 20px; font-size: 15px; background: var(--surface); color: var(--fg); box-shadow: 0 12px 26px -12px color-mix(in oklab, var(--navy) 60%, transparent); }
.pain-stop.pain-quiet:hover { background: var(--surface); }
.pain-pulse { animation: pain-pulse 1.3s var(--ease-in-out) infinite; }
@keyframes pain-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--ink) 55%, transparent); transform: none; } 50% { box-shadow: 0 0 0 14px color-mix(in oklab, var(--ink) 0%, transparent); transform: scale(1.04); } }
.pain-after { font: 700 clamp(22px, 2.2vw, 32px)/1.1 var(--sans); letter-spacing: -0.02em; color: var(--fg); opacity: 0; transform: translateY(8px); transition: opacity 360ms var(--ease-out) 500ms, transform 460ms var(--ease-spring) 500ms; }
.pain-after.in { opacity: 1; transform: none; }

@media (max-width: 520px) { .pain-phone { zoom: 0.86; } }
