:root{font-family:Inter,Arial,Helvetica,sans-serif;color:#222521;background:#f7f7f2;font-synthesis:none;--line:#d7d9d0;--accent:#2459ed}*{box-sizing:border-box}body{margin:0}header{height:88px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;padding:0 5vw}.brand{font-size:21px;font-weight:800;letter-spacing:-1px;color:inherit;text-decoration:none}.brand span{font-size:12px;letter-spacing:1px;font-weight:400;margin-left:10px}.tag,.eyebrow,footer{font-size:11px;letter-spacing:1.5px}.tag{color:#74786b}main{max-width:1000px;margin:auto;padding:64px 32px 32px}#home{padding:40px 0 80px}.eyebrow{color:#74786b;margin:0 0 22px}h1{font-size:clamp(36px,6vw,64px);font-weight:600;letter-spacing:-2.5px;line-height:1.08;margin:0 0 28px}.intro{max-width:540px;font-size:18px;line-height:1.65;color:#65695f;margin-bottom:32px}button,input,select,textarea{font:inherit;border-radius:0}button{background:var(--accent);color:white;border:1px solid var(--accent);padding:14px 20px;cursor:pointer;font-size:14px;font-weight:600}button:hover{filter:brightness(.93)}button:disabled{opacity:.5;cursor:wait}.secondary{background:transparent;color:#222521;border-color:var(--line)}input,select,textarea{background:#fff;border:1px solid var(--line);padding:12px;color:inherit}textarea{width:100%;resize:vertical;min-height:90px;font-size:16px;line-height:1.5}:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.explanation{display:flex;justify-content:space-between;border-top:1px solid var(--line);margin-top:70px;padding-top:24px;font-size:13px;color:#74786b}.room-header{display:flex;align-items:center;justify-content:space-between;gap:20px}.room-header h1{font-size:36px;margin-bottom:24px;letter-spacing:-1px}.room-header .eyebrow{margin-bottom:10px}#join{border:1px solid var(--line);padding:32px;margin-top:20px}h2{font-weight:500;font-size:22px;margin-top:0}.join-row{display:flex;gap:10px}.join-row input{flex:1;min-width:0}.live-bar{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:15px 0;display:flex;justify-content:space-between;gap:15px;font-size:12px;color:#65695f}#presence{text-align:right}#messages{height:clamp(240px,43vh,520px);overflow:auto;overscroll-behavior:contain}.empty{padding:65px 20px;text-align:center;color:#74786b;font-size:15px}.message{padding:22px 8px;border-bottom:1px solid var(--line)}.meta{display:flex;gap:12px;align-items:center;font-size:12px;color:#74786b}.meta strong{color:#222521}.message.mine{border-left:3px solid var(--accent);padding-left:14px}.message p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;margin:10px 0;font-size:16px}details{font-size:12px;color:#74786b}summary{cursor:pointer;display:list-item}details ol{padding-left:20px}details li{margin:12px 0;overflow-wrap:anywhere;white-space:pre-wrap}#compose{padding-top:20px}.settings{display:flex;align-items:center;gap:20px;font-size:12px;color:#65695f;margin-bottom:15px}.settings label{display:flex;align-items:center;gap:8px}.settings input{width:65px}.settings select,.settings input{padding:8px}.compose-bottom{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:12px}#progress{font-size:12px;color:#65695f}#error{border:1px solid #bb4949;color:#a32f2f;padding:15px;font-size:14px;line-height:1.5}footer{border-top:1px solid var(--line);margin:32px 5vw 0;padding:24px 0;display:flex;justify-content:space-between;gap:20px;color:#74786b;font-size:10px;letter-spacing:1px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}[hidden]{display:none!important}@media(max-width:600px){header{height:70px}.tag{display:none}main{padding:35px 20px 20px}#home{padding-top:20px}.explanation{flex-direction:column;gap:16px;margin-top:45px}.room-header{align-items:flex-start}.room-header .secondary{font-size:12px;padding:10px}.room-header h1{font-size:28px}.settings{gap:10px;flex-wrap:wrap}.settings>span{display:none}.compose-bottom{align-items:flex-start;flex-direction:column}.compose-bottom button{width:100%}footer{flex-direction:column}.join-row{flex-direction:column}#join{padding:20px}}

.message{animation:message-aging 60s linear forwards}.message p{color:inherit}@keyframes message-aging{0%,50%{background:transparent;color:#222521}75%{background:#fff0ec;color:#963b30}100%{background:#ffd9d1;color:#b32116}}

.home-actions{display:flex;gap:12px;flex-wrap:wrap}.primary-link{display:inline-block;background:var(--accent);color:white;text-decoration:none;border:1px solid var(--accent);padding:14px 20px;font-size:14px;font-weight:600}.primary-link:hover{filter:brightness(.93)}.public-note{font-size:12px;color:#65695f;margin-top:18px}

.message{padding:8px}.message.mine{padding-left:11px}
.message details{font-size:14px;color:inherit}
.message-row{display:grid;grid-template-columns:42px minmax(60px,120px) minmax(0,1fr) 18px;gap:10px;align-items:baseline;list-style:none;line-height:1.45}
.message-row::-webkit-details-marker{display:none}
.message-row time{font-size:11px;color:#74786b;font-variant-numeric:tabular-nums}
.message-row strong{font-size:12px;overflow-wrap:anywhere}
.message-text{white-space:pre-wrap;overflow-wrap:anywhere}
.expand-icon{color:#74786b;text-align:center;transition:transform .15s}
.message details[open] .expand-icon{transform:rotate(90deg)}
.message details ol{margin:10px 0 4px 52px;color:#65695f;font-size:12px}
@media(max-width:600px){.message-row{grid-template-columns:36px minmax(45px,80px) minmax(0,1fr) 14px;gap:6px}.message details ol{margin-left:42px}}

.message-row{grid-template-columns:42px minmax(0,1fr) 28px;column-gap:10px}
.message-row strong{font-size:14px;margin-right:5px}
.message-row .message-text{display:contents}
.message-row{display:block;position:relative;padding:2px 36px 2px 44px}
.message-row time{position:absolute;left:0;top:5px;font-size:10px;color:#92968b}
.message-text{font-size:14px;line-height:1.6}
.expand-icon{position:absolute;right:0;top:0;display:flex;align-items:center;justify-content:center;width:30px;height:28px;font-size:24px;line-height:1;color:#65695f}
.message details[open] .expand-icon{transform:rotate(180deg)}
@media(max-width:600px){.message-row{display:block;padding-left:38px;padding-right:32px}}

/* Chat bubbles: own messages left, other participants right. */
#messages{padding:12px 0}
.message{width:fit-content;max-width:82%;margin:8px 0 8px auto;padding:10px 14px;border:1px solid var(--line);border-radius:16px 16px 3px 16px;background:#eeefe8}
.message.mine{margin-left:0;margin-right:auto;padding:10px 14px;border:1px solid #cbd5f5;border-radius:16px 16px 16px 3px;background:#eaf0ff}
.message-row{padding-top:2px;padding-bottom:2px}
.message details ol{margin-left:20px;margin-right:16px}
@keyframes message-aging{0%,50%{color:#222521}75%{background:#fff0ec;color:#963b30}100%{background:#ffd9d1;color:#b32116}}
@media(max-width:600px){.message{max-width:92%}}

/* Increasing urgency as a message approaches its one-minute expiry. */
.message{animation:message-expiry 60s linear forwards}
@keyframes message-expiry{
  0%,30%{color:#222521}
  50%{background:#ffe3da;border-color:#f0a38f;color:#8b3027}
  75%{background:#ffb39c;border-color:#e46b51;color:#7b2118}
  90%{background:#ff7a61;border-color:#cb3929;color:#60150e;transform:rotate(0)}
  93%{background:#ff624e;transform:rotate(-.6deg)}
  95%{background:#ff5846;transform:rotate(.6deg)}
  97%{background:#ff4a39;transform:rotate(-.8deg)}
  98%{background:#fa3e2f;transform:rotate(.8deg);opacity:1}
  99%{background:#f03325;transform:rotate(-.5deg);opacity:1}
  100%{background:#e92b20;border-color:#a81d15;color:#fff;transform:rotate(0);opacity:1}
}
@media(prefers-reduced-motion:reduce){
  .message{animation-name:message-expiry-still}
  @keyframes message-expiry-still{
    0%,30%{color:#222521}
    50%{background:#ffe3da;border-color:#f0a38f;color:#8b3027}
    75%{background:#ffb39c;border-color:#e46b51;color:#7b2118}
    100%{background:#f03325;border-color:#a81d15;color:#fff}
  }
}

@media(max-width:600px){
  #messages{height:clamp(180px,28svh,280px)}
  .room-header{gap:12px}
  .room-header .secondary{flex-shrink:0;max-width:130px}
  .live-bar{flex-wrap:wrap}
  #presence{overflow-wrap:anywhere;max-width:100%}
}

.settings{flex-wrap:wrap;gap:12px}
#pause-background{padding:8px 10px;font-size:12px}
#chat[data-background]:not([data-background="none"]){background-size:cover;background-position:center;padding:12px}
#chat[data-background]:not([data-background="none"]) .message{background:#f7f7f2;border-color:#d7d9d0}
#chat[data-background]:not([data-background="none"]) .message.mine{background:#eaf0ff;border-color:#cbd5f5}
#chat[data-background]:not([data-background="none"]) .empty{background:#f7f7f2;padding:16px;margin:40px 0;color:#65695f}
#chat[data-background="stars"]{background-image:url("/backgrounds/stars.gif")}
#chat.background-paused[data-background="stars"]{background-image:url("/backgrounds/stars.png")}
#chat[data-background="clouds"]{background-image:url("/backgrounds/clouds.gif")}
#chat.background-paused[data-background="clouds"]{background-image:url("/backgrounds/clouds.png")}
#chat[data-background="bananas"]{background-image:url("/backgrounds/bananas.gif")}
#chat.background-paused[data-background="bananas"]{background-image:url("/backgrounds/bananas.png")}
#chat[data-background="confetti"]{background-image:url("/backgrounds/confetti.gif")}
#chat.background-paused[data-background="confetti"]{background-image:url("/backgrounds/confetti.png")}


.gif-send-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:12px;font-size:12px;color:#65695f}
.gif-send-row label{display:flex;align-items:center;gap:8px}
.gif-send-row select,.gif-send-row button{padding:8px 10px;font-size:12px}
.message-gif{display:block;width:240px;max-width:100%;height:auto;margin-top:8px}
.gif-message{padding-right:0}

#chat[data-background]:not([data-background="none"]){background-size:cover;background-position:center}
#chat[data-background]:not([data-background="none"]) #compose{background:transparent;padding:16px 0 0}
#chat[data-background]:not([data-background="none"]) .live-bar{background:#f7f7f2;padding:12px}
#chat[data-background]:not([data-background="none"]) .settings label,
#chat[data-background]:not([data-background="none"]) .settings>span,
#chat[data-background]:not([data-background="none"]) .gif-send-row label,
#chat[data-background]:not([data-background="none"]) #progress{background:#f7f7f2;padding:6px;color:#222521}
#chat[data-background]:not([data-background="none"]) .secondary{background:#f7f7f2}
#chat[data-background]:not([data-background="none"]) #messages{padding:12px 0}

header{gap:18px}
.header-background{display:flex;align-items:center;gap:8px;margin-right:auto;font-size:11px;color:#65695f}
.header-background label{display:flex;align-items:center;gap:7px}
.header-background select{padding:5px 7px;font-size:11px;max-width:135px}
.header-background #pause-background{padding:5px 7px;font-size:11px}
.gif-send-row{gap:7px;margin:6px 0 0;font-size:11px}
.gif-send-row select,.gif-send-row button{padding:5px 8px;font-size:11px}
.gif-send-row label{gap:6px}
@media(max-width:600px){header{height:auto;min-height:70px;padding-top:12px;padding-bottom:12px;flex-wrap:wrap;gap:10px}.header-background{flex-wrap:wrap;margin-right:0}.header-background label{gap:5px}}

.settings input[type="range"]{width:130px;padding:0;accent-color:var(--accent);cursor:pointer}#count-value{min-width:20px;font-variant-numeric:tabular-nums;font-weight:600}

#count-value{min-width:88px;font-weight:600}

#send{touch-action:none;user-select:none;-webkit-user-select:none;position:relative;transform-origin:center;z-index:2}
#send.charging{background:color-mix(in srgb,var(--accent),#ef3028 calc(var(--charge,0)*100%));border-color:transparent;animation:charge-shake .16s linear infinite;box-shadow:0 0 0 calc(3px + var(--charge,0)*8px) #ef302825}
@keyframes charge-shake{0%,100%{transform:scale(calc(1.03 + var(--charge,0)*.17)) translateX(0)}25%{transform:scale(calc(1.03 + var(--charge,0)*.17)) translateX(calc(var(--charge,0)*-3px)) rotate(calc(var(--charge,0)*-1deg))}75%{transform:scale(calc(1.03 + var(--charge,0)*.17)) translateX(calc(var(--charge,0)*3px)) rotate(calc(var(--charge,0)*1deg))}}
.hold-hint{font-size:11px;color:#74786b;text-align:right;margin:12px 0 0}
#charge-popover{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:20;pointer-events:none;background:#222521;color:white;border:2px solid #fff;padding:28px 32px;min-width:260px;max-width:90vw;text-align:center;box-shadow:0 16px 60px #0004}
#charge-popover>span{font-size:10px;letter-spacing:2px;color:#d5d9cd}
#charge-level{display:block;font-size:38px;margin:12px 0;line-height:1.1}
#charge-count{font-size:14px;margin:0 0 16px}
#charge-popover small{font-size:11px;color:#d5d9cd}
#charge-popover.max-chaos{background:#ba241c}


#charge-level{font-size:calc(32px + var(--charge,0)*16px);transition:font-size .2s}

.compose-bottom{min-width:0}#progress{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.compose-bottom #send{flex-shrink:0}@media(max-width:600px){#progress{width:100%;flex:none}}

/* Brief swell, then a fast pop into nothing. */
.message.leaving{position:relative;pointer-events:none;overflow:hidden;background:#e92b20!important;color:#fff;transform-origin:center;animation:message-pop .42s ease-in forwards!important;animation-delay:0s!important}
@keyframes message-pop{
  0%{max-height:var(--exit-height);opacity:1;transform:scale(1)}
  40%{max-height:var(--exit-height);opacity:1;transform:scale(1.12)}
  55%{max-height:var(--exit-height);opacity:1;transform:scale(1.1)}
  85%{max-height:var(--exit-height);opacity:.5;transform:scale(.08)}
  100%{max-height:0;margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;border-width:0;opacity:0;transform:scale(0)}
}


#chat[data-background="cat-yes"]{background-image:url("/backgrounds/cat-yes.gif");background-size:480px 270px;background-repeat:repeat}
#chat[data-background="cat-no"]{background-image:url("/backgrounds/cat-no.gif");background-size:480px 270px;background-repeat:repeat}
#chat[data-background="cat-bye"]{background-image:url("/backgrounds/cat-bye.gif");background-size:480px 270px;background-repeat:repeat}
#chat[data-background="cat-hi"]{background-image:url("/backgrounds/cat-hi.gif");background-size:480px 270px;background-repeat:repeat}
#chat[data-background="cat-sorry"]{background-image:url("/backgrounds/cat-sorry.gif");background-size:480px 270px;background-repeat:repeat}
#chat[data-background="cat-why"]{background-image:url("/backgrounds/cat-why.gif");background-size:480px 270px;background-repeat:repeat}
#chat[data-background="cat-promise"]{background-image:url("/backgrounds/cat-promise.gif");background-size:480px 270px;background-repeat:repeat}
#chat[data-background="cat-please"]{background-image:url("/backgrounds/cat-please.gif");background-size:480px 270px;background-repeat:repeat}
#chat[data-background="cat-sad"]{background-image:url("/backgrounds/cat-sad.gif");background-size:480px 270px;background-repeat:repeat}
#chat[data-background^="cat-"]:not([data-background="none"]){background-size:480px 270px;background-repeat:repeat}

/* Content-first chat mode and the first experience-plan iteration. */
body.chat-active{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
body.chat-active header{height:42px;min-height:42px;padding:0 14px;gap:12px;flex-wrap:nowrap;border-bottom:1px solid var(--line)}
body.chat-active .brand{font-size:15px;letter-spacing:-.5px}
body.chat-active .brand span,body.chat-active .tag,body.chat-active footer,body.chat-active .room-header,body.chat-active #hold-hint{display:none!important}
body.chat-active #room-title{font-size:12px;letter-spacing:0;font-weight:500;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;order:1;color:#65695f}
body.chat-active .header-background{margin:0;order:3;font-size:11px;position:relative}
body.chat-active #copy{padding:5px 8px;font-size:11px;white-space:nowrap;order:2}
body.chat-active main{flex:1;min-height:0;width:100%;max-width:1100px;padding:0 12px;display:flex;flex-direction:column}
body.chat-active #room{flex:1;min-height:0;display:flex;flex-direction:column}
body.chat-active #chat{flex:1;min-height:0;display:flex;flex-direction:column;padding:0!important;background-attachment:local}
body.chat-active .live-bar{padding:7px 4px!important;border-top:0;font-size:11px;min-height:27px;justify-content:flex-end;flex:none}
body.chat-active #connection:empty{display:none}
body.chat-active #presence{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
body.chat-active #messages{flex:1;min-height:0;height:auto;padding:8px 4px!important;scrollbar-width:thin}
body.chat-active #compose{padding:10px 0 8px!important;border-top:1px solid var(--line);flex:none}
body.chat-active textarea{min-height:44px;max-height:150px;resize:none;padding:11px 12px;font-size:16px}
body.chat-active .compose-bottom{margin-top:7px;flex-direction:row;align-items:center;gap:12px}
body.chat-active #send{width:auto;flex:0 0 auto;min-height:44px;padding:10px 20px;font-size:14px}
body.chat-active #progress{font-size:11px;width:auto;min-width:0;flex:1 1 0}
body.chat-active #error{flex:none;margin:0 0 8px;padding:8px;font-size:12px}
#new-messages{position:absolute;z-index:4;align-self:center;top:80px;font-size:12px;padding:8px 12px;background:white;box-shadow:0 2px 10px #0001}
.header-background summary{list-style:none;cursor:pointer;padding:7px;font-size:11px}
.header-background summary::-webkit-details-marker{display:none}
.background-panel{position:absolute;right:0;top:35px;z-index:12;background:#f7f7f2;border:1px solid var(--line);padding:12px;box-shadow:0 8px 25px #0002;width:290px;max-width:90vw}
.background-panel>label{display:none}
#background-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.background-choice{font-size:10px;min-height:55px;padding:7px;color:#222521;background:#eeefe8;border:2px solid transparent;text-shadow:0 1px 3px white;background-size:cover}
.background-choice[aria-pressed="true"]{border-color:var(--accent)}
button:active,.primary-link:active{transform:scale(.97)}
button.confirmed{background:#dfeddc;border-color:#96b190}
.message.pending{animation:none;background:#edf1fa!important;border:1px dashed #a5b4dc;max-width:85%;min-width:160px}
.journey-label{font-size:10px;color:#536482;display:block}
.message.pending .journey-text{margin:7px 0;font-size:14px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;max-height:130px;overflow:auto}
.message.pending.failed{background:#fff1e9!important;border-color:#cb9c82}
.journey-error{font-size:12px!important;color:#8b4f37}
.journey-actions{display:flex;gap:8px;margin:10px 0}
.journey-actions button{min-height:44px;font-size:12px;padding:8px 10px}
.message.pending details{font-size:11px}
.message.pending details p{font-size:11px;max-width:400px}
.message.landed .message-row{animation:message-land .22s ease-out}
@keyframes message-land{from{opacity:.5;transform:translateY(6px) scale(.97)}to{opacity:1;transform:none}}
#send{transition:background .12s,box-shadow .12s}
@media(max-width:600px){body.chat-active header{gap:5px;padding:0 8px}body.chat-active main{padding:0 8px}body.chat-active #room-title{font-size:11px}body.chat-active .header-background summary{font-size:0}body.chat-active .header-background summary::after{content:'✦';font-size:18px}body.chat-active #copy{font-size:10px}body.chat-active .message{max-width:92%}}
@media(prefers-reduced-motion:reduce){.message.landed .message-row{animation:none}button:active,.primary-link:active{transform:none}}

.background-choice[data-theme="stars"]{background-image:url("/backgrounds/stars.png")}
.background-choice[data-theme="clouds"]{background-image:url("/backgrounds/clouds.png")}
.background-choice[data-theme="bananas"]{background-image:url("/backgrounds/bananas.png")}
.background-choice[data-theme="confetti"]{background-image:url("/backgrounds/confetti.png")}
.background-choice[data-theme="cat-yes"]{background-image:url("/backgrounds/cat-yes.png")}
.background-choice[data-theme="cat-no"]{background-image:url("/backgrounds/cat-no.png")}
.background-choice[data-theme="cat-bye"]{background-image:url("/backgrounds/cat-bye.png")}
.background-choice[data-theme="cat-hi"]{background-image:url("/backgrounds/cat-hi.png")}
.background-choice[data-theme="cat-sorry"]{background-image:url("/backgrounds/cat-sorry.png")}
.background-choice[data-theme="cat-why"]{background-image:url("/backgrounds/cat-why.png")}
.background-choice[data-theme="cat-promise"]{background-image:url("/backgrounds/cat-promise.png")}
.background-choice[data-theme="cat-please"]{background-image:url("/backgrounds/cat-please.png")}
.background-choice[data-theme="cat-sad"]{background-image:url("/backgrounds/cat-sad.png")}
/* Presence stays quiet until someone else joins. */
#presence{display:inline-flex;align-items:center;gap:7px}
#presence::before{content:'';width:6px;height:6px;flex:none;border-radius:50%;background:#a8ada4}
#presence.alive::before{background:#51a778;animation:presence-pulse 2s ease-out infinite}
@keyframes presence-pulse{0%{box-shadow:0 0 0 0 #51a77866}70%,100%{box-shadow:0 0 0 6px #51a77800}}
@media(prefers-reduced-motion:reduce){#presence.alive::before{animation:none}}

/* Short bursts respond to actions without moving the reading layout. */
.interaction-particle{position:fixed;width:6px;height:6px;pointer-events:none;z-index:100;contain:strict;border-radius:1px}
@keyframes message-land{0%{opacity:.3;transform:translateY(18px) scale(.8) rotate(-2deg)}65%{opacity:1;transform:translateY(-3px) scale(1.04) rotate(1deg)}100%{opacity:1;transform:none}}
.message.landed .message-row{animation-duration:.38s}
@keyframes charge-shake{0%,100%{transform:scale(calc(1 + var(--charge,0)*.22)) rotate(calc(var(--charge,0)*-3deg))}25%{transform:translate(-2px,1px) scale(calc(1 + var(--charge,0)*.22)) rotate(calc(var(--charge,0)*3deg))}75%{transform:translate(2px,-1px) scale(calc(1 + var(--charge,0)*.22)) rotate(calc(var(--charge,0)*-3deg))}}
#charge-popover.max-chaos strong{animation:chaos-wobble .3s ease-in-out infinite alternate}
@keyframes chaos-wobble{from{transform:rotate(-3deg) scale(1)}to{transform:rotate(3deg) scale(1.08)}}
.message.pending .journey-label::before{content:'↻ ';display:inline-block;animation:journey-spin 1.2s linear infinite}
.message.pending.failed .journey-label::before{animation:none;content:'! '}
@keyframes journey-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#charge-popover.max-chaos strong,.message.pending .journey-label::before{animation:none}}

/* Keep the composer inside the visible area when mobile keyboards open. */
body.chat-active{position:fixed;top:var(--chat-top,0px);left:0;right:0;height:var(--chat-height,100dvh)}
body.chat-active #compose{position:relative;padding-bottom:max(8px,env(safe-area-inset-bottom))!important}
@media(max-width:600px){
 #charge-popover{position:absolute;top:auto;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);min-width:0;width:min(300px,calc(100vw - 32px));padding:12px 16px;max-height:calc(var(--chat-height,100dvh) - 170px);overflow:hidden;box-shadow:0 6px 24px #0003}
 #charge-popover strong{font-size:30px;margin:4px 0}
 #charge-popover p{margin:4px 0}
 #charge-popover small{display:none}
}

/* One composer row, with the hold hint beneath it. */
body.chat-active #compose{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;column-gap:8px;row-gap:5px}
body.chat-active #text{grid-column:1;grid-row:1;min-width:0;display:block}
body.chat-active #send{grid-column:2;grid-row:1;align-self:end;white-space:nowrap}
body.chat-active #progress{grid-column:1 / -1;grid-row:2;font-size:10px;line-height:14px;padding:0 2px}
@media(max-width:400px){body.chat-active #send{padding:10px 12px}}

/* Feedback overlays the chat; it never changes the composer geometry. */
body.chat-active #error{position:absolute;left:0;right:0;bottom:calc(100% + 8px);z-index:25;margin:0;padding:10px 14px;background:#fff1e9;color:#873b2d;border:1px solid #d5a08c;box-shadow:0 4px 16px #0002;max-height:min(160px,30dvh);overflow:auto;overflow-wrap:anywhere;line-height:1.4;font-size:12px}

/* Shared geometry for the chat controls and text baselines. */
body.chat-active #text{min-height:48px;line-height:24px;padding:11px 12px;margin:0;vertical-align:top}
body.chat-active #send{height:48px;min-height:48px;line-height:24px;padding-top:11px;padding-bottom:11px;margin:0;display:flex;align-items:center;justify-content:center}
body.chat-active #progress{padding:0;line-height:16px}
body.chat-active header{padding-left:12px;padding-right:12px;align-items:center}
body.chat-active .brand,body.chat-active #room-title{line-height:20px;min-width:0}
body.chat-active .brand{flex-shrink:0}
body.chat-active #room-title{flex:1 1 0}
body.chat-active #copy,body.chat-active .header-background summary{height:30px;line-height:18px;padding-top:5px;padding-bottom:5px}
body.chat-active .live-bar{padding-left:0!important;padding-right:0!important;align-items:center;flex-wrap:nowrap}
body.chat-active #messages{padding-left:0!important;padding-right:0!important}
.message-row{line-height:22px;min-height:26px}
.message-row time{top:2px;line-height:22px}
.expand-icon{top:0;height:26px}
@media(max-width:600px){body.chat-active header{padding-left:8px;padding-right:8px}}

/* Chaos has visible levels; the journey meter uses completed translations. */
#charge-mascot{font-size:44px;line-height:1.2;transform-origin:center}
#charge-meter{display:flex;gap:4px;justify-content:center;margin:12px 0}
#charge-meter i{height:7px;flex:1;background:#ffffff26;transition:background .12s,transform .12s}
#charge-meter i.filled{background:#f6d354;transform:scaleY(1.3)}
#charge-popover[data-level="Knäpp"]{background:#4c3786}
#charge-popover[data-level="Bananas"]{background:#795211}
#charge-popover[data-level="Crazy"]{background:#ba241c}
#charge-popover.max-chaos #charge-mascot{animation:chaos-wobble .15s ease-in-out infinite alternate}
.interaction-particle.emoji-particle{width:20px;height:24px;font-size:20px;line-height:24px;contain:none;border-radius:0}
.journey-meter{height:3px;background:#ced9ee;position:relative;overflow:hidden;margin-top:8px}
.journey-meter::after{content:'';display:block;height:100%;width:100%;background:#2459ed;transform-origin:left;transform:scaleX(var(--journey,0));transition:transform .25s ease-out}
.pending.failed .journey-meter{display:none}
#progress.reward{color:#2459ed;font-weight:600}
@media(max-width:600px){#charge-mascot{font-size:32px}#charge-meter{margin:8px 0}#charge-popover>span{display:none}}
@media(prefers-reduced-motion:reduce){#charge-popover.max-chaos #charge-mascot{animation:none}.journey-meter::after,#charge-meter i{transition:none}}

/* Charge feedback grows around its anchor, without moving the composer. */
#charge-popover{transform:translate(-50%,-50%) scale(calc(1 + var(--charge,0)*.18));animation:popover-shake .18s linear infinite;transform-origin:center}
@keyframes popover-shake{0%,100%{translate:0 0;rotate:0deg}25%{translate:calc(var(--charge,0)*-8px) calc(var(--charge,0)*1px);rotate:calc(var(--charge,0)*-4deg)}75%{translate:calc(var(--charge,0)*8px) calc(var(--charge,0)*-1px);rotate:calc(var(--charge,0)*4deg)}}
@media(max-width:600px){#charge-popover{transform:translateX(-50%) scale(calc(1 + var(--charge,0)*.12));transform-origin:center bottom;width:min(270px,calc((100vw - 40px)/1.12))}}


