#cafe-enter[hidden]{display:none}
body:has(dialog[open]) #cafe-enter{display:none}
body.at-cafe .brand{visibility:hidden}
#cafe-enter{z-index:5;max-width:calc(100vw - 32px);white-space:nowrap}
.cafe .room-heading{z-index:2;padding:16px 20px;border-radius:18px;background:#fffaf2ed;max-width:min(370px,calc(100vw - 40px))}
.cafe .room-heading h1{font-size:30px}
.cafe .room-heading p{margin:8px 0 0}
.cafe .room-guide{padding:8px 12px;background:#fffaf2e6;border-radius:12px}
@media(max-width:700px){.cafe .room-heading{padding:12px 16px}.cafe .room-heading h1{font-size:25px}.cafe .room-heading p{max-width:240px}}
@media(max-height:500px){.cafe .room-heading{padding:8px 12px;top:12px;left:12px}.cafe .room-heading .eyebrow{display:none}}

.cafe-presence{position:fixed;z-index:3;transform:translate(-50%,-100%);max-width:190px;padding:8px 12px;border:2px solid #ad8970;border-radius:9px;background:#fff3dc;color:var(--grafite);font-size:12px;font-weight:800;text-align:center;box-shadow:0 3px 0 #84685140;pointer-events:none}
.cafe-presence[hidden],.cafe-guest-label[hidden]{display:none}
.cafe-guest-label{position:fixed;z-index:2;transform:translate(-50%,-100%);max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:3px 8px;border:2px solid;border-radius:12px;background:#fffaf2ed;font-size:11px;pointer-events:none}
.cafe-speech-bubble{position:fixed;z-index:4;transform:translate(-50%,-100%);width:max-content;max-width:min(240px,calc(100vw - 32px));padding:10px 14px;border:1px solid #b8acc4;border-radius:16px;background:var(--marfim);color:var(--grafite);box-shadow:0 4px 14px #493f4819;font:600 13px/1.45 'Nunito Sans',sans-serif;white-space:pre-wrap;overflow-wrap:anywhere;pointer-events:none}
.cafe-speech-bubble::after{content:'';position:absolute;bottom:-6px;left:calc(50% - 5px);width:10px;height:10px;background:var(--marfim);border-right:1px solid #b8acc4;border-bottom:1px solid #b8acc4;transform:rotate(45deg)}
.cafe-speech-bubble[hidden]{display:none}
#cafe-chat{position:fixed;z-index:5;right:24px;top:100px;bottom:26px;display:flex;flex-direction:column;width:310px;max-height:calc(100dvh - 126px);padding:18px;border:1px solid var(--borda);border-radius:22px;background:#fffaf2f5;box-shadow:0 8px 30px #493f4812;gap:12px}
#cafe-chat header{display:flex;align-items:center;justify-content:space-between;gap:8px}
#cafe-chat h2{font:500 23px Fredoka,sans-serif;margin:0}
#cafe-chat-close{display:none;font-size:26px;width:44px;height:44px;border-radius:10px;background:var(--lavanda)}
#cafe-chat p{margin:0;font-size:12px;line-height:1.5}
#cafe-connection{color:var(--texto-suave)}
#cafe-identity{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px;border:1px solid var(--borda);border-radius:10px;background:#fff}
#cafe-identity[hidden]{display:none}
#cafe-current-nickname{font-size:12px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#cafe-change-nickname{min-height:32px;padding:4px 10px;font-size:11px;font-weight:700;background:var(--lavanda);color:var(--grafite);flex:none}
#cafe-join{display:grid;gap:10px}
#cafe-join[hidden]{display:none}
#cafe-chat label,#cafe-chat summary{font-size:13px;font-weight:700}
#cafe-chat input{font:14px 'Nunito Sans',sans-serif;border:1px solid var(--borda);border-radius:10px;padding:10px 12px;min-height:44px;min-width:0;width:100%;background:white;color:var(--grafite)}
#cafe-chat button{min-height:44px;border-radius:10px;padding:8px 12px}
#cafe-join button,#cafe-send{background:var(--grafite);color:var(--marfim);font-weight:700}
#cafe-chat button:disabled{opacity:.55;cursor:default}
#cafe-chat .cafe-note{font-size:11px;color:var(--texto-suave)}
#cafe-chat details{flex:none;font-size:12px;max-height:25%;overflow:auto}
#cafe-chat summary{min-height:32px;cursor:pointer}
#cafe-people>div{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--borda)}
#cafe-people span{overflow-wrap:anywhere}
#cafe-people button{font-size:11px;background:var(--lavanda);flex:none}
#cafe-messages{flex:1;min-height:50px;overflow:auto;overscroll-behavior:contain;list-style:none;padding:0;margin:0;scrollbar-gutter:stable}
#cafe-messages li{border-left:3px solid var(--guest-color);padding:3px 9px;margin:0 0 14px;overflow-wrap:anywhere}
#cafe-messages strong{font-size:12px;color:var(--guest-color)}
#cafe-messages time{font-size:10px;margin-left:8px;color:var(--texto-suave)}
#cafe-messages p{margin-top:4px}
#cafe-message-form{display:flex;gap:8px;flex:none}
#cafe-feedback:empty{display:none}
#cafe-chat-toggle{display:none;position:fixed;z-index:6;right:20px;bottom:max(84px,calc(env(safe-area-inset-bottom) + 84px));min-height:44px;padding:10px 14px;border-radius:12px;background:var(--lavanda);color:var(--grafite);font-size:12px;font-weight:800}
@media(max-width:1000px){
  #cafe-chat-toggle{display:block}
  #cafe-chat{display:none;top:auto;bottom:max(144px,calc(env(safe-area-inset-bottom) + 144px));right:16px;width:min(340px,calc(100vw - 32px));max-height:calc(100dvh - 170px);height:520px;padding:14px;border-radius:18px}
  #cafe-chat.is-open{display:flex}
  #cafe-chat-close{display:block}
  #cafe-chat h2{font-size:21px}
}
@media(min-width:1001px){.cafe .room-guide{max-width:calc(100vw - 400px)}}
@media(max-height:500px){
  #cafe-chat-toggle{display:block;bottom:76px}
  #cafe-chat{display:none;inset:12px 16px 12px auto;height:auto;width:min(340px,calc(100vw - 32px));max-height:calc(100dvh - 24px);overflow:auto}
  #cafe-chat.is-open{display:flex}#cafe-chat-close{display:block}#cafe-messages{flex:none;min-height:80px;max-height:130px}
}

.cafe-course-link{display:inline-block;pointer-events:auto;margin-left:8px;font-size:11px;font-weight:700;color:var(--grafite,#493f48);text-decoration:underline}
.cafe-course-link:hover{color:var(--foco,#f5a58d)}
.cafe-rules{margin:10px 0;font-size:11px;color:var(--texto-suave,#6f626e);line-height:1.5}
.cafe-rules summary{cursor:pointer;font-weight:700;color:var(--grafite,#493f48)}
.cafe-rules p{margin:6px 0 0}
