/* Chat V5 — measured against screens 01, 04a–d and 13, components and ROZMERY.md. */
.chat-window{--pismo:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",system-ui,sans-serif}
.chat-window .chat-head{gap:10px;flex-shrink:0}
.chat-head>.v5-chat-person,.chat-head>.v5-chat-person .avatar{width:32px;height:32px;flex:0 0 32px!important;font-size:12px}
.chat-head>.v5-chat-person .presence-dot{width:10px;height:10px;border-color:white}
.chat-head .chat-heading{flex:1;min-width:0}
.chat-head .chat-heading strong{font-size:14px;line-height:18px}
.chat-head .chat-heading small{font-size:12px;line-height:16px}
.chat-head button{border-radius:7px;flex-shrink:0}
.chat-window.is-full .chat-close{display:none}
.chat-window.is-full .chat-head{height:64px;padding:0 22px}
.chat-window .chat-messages{padding:12px 14px 8px;min-height:0;overflow:auto;flex:1}
.chat-message-stack{min-height:100%;display:flex;flex-direction:column;align-items:stretch}
.chat-message-stack:before{content:"";flex:1 0 0}
.chat-day{flex:none;text-align:center;font-size:11.5px;font-weight:500;color:var(--text-3);margin:8px 0 18px}
.chat-window .chat-message,.chat-full .chat-message{display:flex;gap:9px;align-items:flex-start;position:relative;flex:none;padding:0;margin:0 0 14px;max-width:100%;background:transparent}
.chat-window .chat-message.mine{justify-content:flex-end;margin:0 0 14px}
.chat-window .chat-message.grouped{margin-top:-10px}
.chat-window .chat-message.grouped:not(.mine){padding-left:35px}
.chat-message>.avatar{flex:0 0 26px;width:26px;height:26px;font-size:10px}
.chat-window .chat-message>div.chat-message-body{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:4px;padding:0;margin:0;min-width:0;max-width:calc(100% - 35px);color:var(--inkoust);position:relative}
.chat-window .chat-message.grouped>div.chat-message-body,.chat-window .chat-message.mine>div.chat-message-body{max-width:100%}
.chat-window .chat-message.mine>div.chat-message-body{align-items:flex-end}
.chat-message-author{display:flex;align-items:center;gap:6px;padding-left:4px;height:16px}
.chat-message-author strong{font-size:12.5px;font-weight:600}
.chat-message-author i{height:4px;width:4px;border-radius:50%;background:var(--ramecek-policko)}
.chat-message-author time{font-size:12px;color:var(--text-3);font-weight:400}
.chat-bubble-wrap{position:relative;max-width:100%}
.chat-window .chat-message p{padding:9px 13px;border-radius:18px;font-size:14px;line-height:20px;max-width:240px;overflow-wrap:anywhere;white-space:pre-wrap;margin:0;display:block}
.chat-window.is-full .chat-message p{max-width:520px}
.chat-window .chat-message .chat-message-meta{margin:0;padding:0 4px;font-size:11.5px;line-height:16px;color:var(--text-3)}
.chat-bubble-wrap:has(.chat-reactions:not(:empty)){margin-bottom:12px}
.chat-bubble-wrap .chat-reactions{position:absolute;bottom:-12px;right:-8px;display:flex;gap:3px;z-index:1}
.chat-reactions button{height:22px;min-height:22px;padding:0 7px;border:1px solid var(--linka);border-radius:11px;background:white;font-size:12px;font-weight:500;color:var(--text-2)}
.chat-message-body .chat-hover-actions{position:absolute;top:-32px;right:0;display:flex;gap:0;border:1px solid var(--linka);border-radius:12px;background:white;box-shadow:0 2px 8px #00000012;padding:3px;z-index:3;opacity:0;pointer-events:none;white-space:nowrap}
.chat-message:hover .chat-hover-actions,.chat-message:focus-within .chat-hover-actions{opacity:1;pointer-events:auto}
.chat-hover-actions button{width:27px;height:26px;min-height:26px;padding:2px;font-size:16px}
.chat-hover-actions button:hover{background:var(--plocha-mekka)}
.chat-hover-actions .ui-icon{width:15px;height:15px}
.chat-window .chat-linked-card{width:250px;max-width:100%;padding:10px 12px!important;display:flex;flex-direction:column;gap:7px;align-items:stretch;text-align:left;border:1px solid var(--linka);border-radius:12px;background:white;opacity:1}
.chat-window.is-full .chat-linked-card{width:300px}
.chat-linked-card small{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--text-2)}
.chat-linked-card .project-logo{width:14px;height:14px;flex:0 0 14px}
.chat-linked-card strong{font-size:13.5px;font-weight:600;line-height:18px;overflow-wrap:anywhere}
.chat-linked-card>span{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;color:var(--text-2)}
.chat-linked-card .avatar{width:16px;height:16px;font-size:6px}
.chat-linked-card .ui-icon{width:14px;height:14px}
.chat-linked-card b{margin-left:auto;color:var(--projekt-tmava);font-size:12px;font-weight:600;white-space:nowrap}
.chat-window .chat-file{width:240px;max-width:100%;padding:9px;gap:10px;margin-top:0}
.chat-file> .ui-icon:first-child{width:32px;height:32px;padding:8px;background:var(--plocha-mekka);border-radius:8px}
.chat-file> .ui-icon:last-child{width:15px;height:15px}
.chat-file strong{font-size:12.5px;line-height:17px}
.chat-file small{font-size:11.5px}
.chat-file img{height:180px;max-width:240px;object-fit:contain}
.chat-window .chat-typing{display:flex;align-items:center;gap:9px;flex:none;padding:0 14px 14px;min-height:0;font-size:12px;color:var(--text-3)}
.chat-window .chat-typing:empty{display:none}
.chat-typing .avatar{width:26px;height:26px;font-size:10px;flex:none}
.chat-typing-dots{display:flex;gap:4px;background:var(--bublina);border-radius:18px;padding:11px 12px}
.chat-typing-dots i{width:6px;height:6px;border-radius:50%;background:var(--pise-tecky);animation:chat-typing-dot 1.2s infinite}
.chat-typing-dots i:nth-child(2){animation-delay:.2s}.chat-typing-dots i:nth-child(3){animation-delay:.4s}
@keyframes chat-typing-dot{0%,60%,100%{opacity:.35}30%{opacity:1}}
@media(prefers-reduced-motion:reduce){.chat-typing-dots i{animation:none}}
.chat-window [data-chat-send]{padding:4px 10px 10px;max-height:none;border:0;background:white;flex:none}
.chat-window .chat-compose-row{display:flex;align-items:center;gap:2px;min-height:44px;padding:0 6px;border:1px solid var(--ramecek-pole);border-radius:22px;background:white}
.chat-window .chat-compose-row textarea{flex:1;min-width:0;width:0;border:0;border-radius:0;min-height:40px;height:40px;max-height:120px;padding:10px 4px;margin:0;font-size:13.5px;line-height:20px;background:transparent;box-shadow:none}
.chat-compose-row textarea:focus{outline:0;box-shadow:none}
.chat-compose-row:focus-within{outline:2px solid var(--projekt-linka);outline-offset:1px}
.chat-window .chat-compose-row>button{width:28px;height:28px;min-height:28px;flex:0 0 28px;padding:5px;border:0}
.chat-window .chat-compose-row>button .ui-icon{width:16px;height:16px}
.chat-window .chat-compose-row>[data-chat-submit]{width:32px;height:32px;min-height:32px;flex-basis:32px;padding:8px;border-radius:50%;background:var(--projekt-barva);color:var(--projekt-na-barve)}
.chat-window .chat-compose-tools{display:none}
.chat-attachment-menu{position:absolute;bottom:100%;left:10px;right:10px;padding:6px;border:1px solid var(--ramecek-plovouci);border-radius:12px;background:white;box-shadow:var(--stin-plovouci);z-index:5}
.chat-attachment-menu button{display:flex;gap:8px;align-items:center;justify-content:flex-start;width:100%;padding:7px 8px;font-size:12px}
.chat-attachment-menu button:after{content:attr(aria-label)}
.chat-attachment-menu small{display:block;font-size:10px;color:var(--text-3);padding:6px}
.chat-draft-files{margin-left:0}
.chat-window.is-full [data-chat-send]{padding:4px 22px 18px}
.chat-window.is-full .chat-compose-row{min-height:88px;display:flex;flex-wrap:wrap;padding:6px 8px 8px;gap:6px;border-radius:16px}
.chat-window.is-full .chat-compose-row textarea{flex:1 0 100%;width:100%;order:-1;padding:2px 4px;min-height:28px;height:28px;max-height:120px}
.chat-window.is-full .chat-compose-tools{display:flex;padding:0;gap:6px;margin:0}
.chat-window.is-full .chat-compose-tools button{width:28px;height:28px;min-height:28px;padding:5px}
.chat-window.is-full [data-chat-submit]{margin-left:auto}
.chat-window.is-full .chat-messages{padding:12px 28px 14px}
.chat-window.is-full .chat-typing{padding:0 28px 14px}
.chat-window.is-full .chat-head .v5-chat-person,.chat-window.is-full .chat-head .avatar{width:38px;height:38px;flex-basis:38px!important;font-size:14px}
.v5-chat-shell .chat-full{grid-template-columns:320px minmax(280px,1fr)300px}
.v5-chat-shell .chat-full.profile-hidden{grid-template-columns:320px minmax(280px,1fr)}
.chat-full #chat-profile{padding:20px}
.chat-profile-identity{margin:28px 0 14px}
.chat-profile-identity>.v5-chat-person{display:block!important;overflow:visible!important;width:72px;height:72px;margin:0 auto;flex-basis:72px!important}
.chat-profile-identity .avatar{width:72px;height:72px;font-size:27px}
.chat-profile-identity .presence-dot{width:22px;height:22px;right:-1px;bottom:-1px;border:3px solid white}
.chat-profile-identity h2{margin:12px 0 5px;font-size:16px}
.chat-profile-projects{margin:0 0 16px;gap:4px}
.v5-chat-shell .chat-conversations{padding:20px 14px}
.chat-conversations .chat-list-heading{margin:0 4px 12px;height:26px}
.chat-conversations .chat-filters{justify-content:flex-start;gap:14px;margin:0 0 10px}
.chat-conversations .chat-filters button{padding:0;min-height:38px}
.chat-conversations .chat-room.active{border-radius:0}
.chat-conversations .chat-room .v5-chat-person{display:block!important;flex:0 0 32px!important;overflow:visible!important}
.chat-conversations .chat-room .chat-name{font-size:13px}
.chat-conversations .chat-room .chat-preview{font-size:12px}
.chat-conversations .side-caption{padding:8px 0 5px!important;margin-left:4px!important;font-weight:400!important}
.chat-search-results>button{display:block;width:100%;text-align:left;padding:10px;border-bottom:1px solid var(--linka)}
.chat-search-results strong,.chat-search-results span{display:block;font-size:12px;overflow-wrap:anywhere}.chat-search-results span{font-size:14px;font-weight:400;margin-top:4px}
.chat-notice{position:fixed;right:20px;bottom:20px;width:360px;max-width:calc(100vw - 32px);padding:14px 14px 12px;border:1px solid var(--ramecek-plovouci);border-radius:14px;background:white;box-shadow:var(--stin-plovouci);z-index:90;overflow:hidden;display:flex;flex-direction:column;gap:10px;color:var(--inkoust)}
.chat-notice header{display:flex;align-items:center;gap:10px}.chat-notice header>.avatar,.chat-notice header .v5-chat-person,.chat-notice header .avatar{width:36px;height:36px;flex:0 0 36px!important;font-size:14px}.chat-notice header>div{flex:1;min-width:0}.chat-notice header strong{font-size:13.5px;font-weight:600}.chat-notice header small{font-size:12px;color:var(--text-3)}.chat-notice header span:not(.avatar):not(.v5-chat-person):not(.project-logo){display:flex;align-items:center;gap:5px;font-size:12px;color:var(--text-2)}.chat-notice header .project-logo{width:12px;height:12px;flex:0 0 12px}.chat-notice header button{padding:3px;width:24px;height:24px;min-height:24px}
.chat-notice>p{font-size:14px;line-height:20px;margin:0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.chat-notice form{display:flex;align-items:center;gap:4px;border:1px solid var(--ramecek-pole);border-radius:19px;height:38px;padding:3px 4px 3px 12px}.chat-notice form input{border:0;background:transparent;min-width:0;flex:1;padding:0;min-height:30px;font-size:13px;box-shadow:none}.chat-notice form button{border:0;width:30px;height:30px;min-height:30px;padding:7px;border-radius:50%}.chat-notice .ui-icon{width:16px;height:16px}.chat-notice footer{display:flex;gap:12px}.chat-notice footer button{padding:0;border:0;font-size:12.5px;color:var(--text-2);font-weight:500;display:flex;gap:6px;align-items:center}.chat-notice footer .ui-icon{width:14px;height:14px}.chat-notice-countdown{position:absolute;left:0;bottom:0;height:2px;width:100%;background:var(--projekt-barva);transform-origin:left}.chat-notice-error:empty{display:none}.chat-notice-error{font-size:12px;color:var(--chyba-text)}
@media(max-width:1199px){.v5-chat-shell .chat-full{grid-template-columns:240px minmax(260px,1fr)240px}.v5-chat-shell .chat-full.profile-hidden{grid-template-columns:240px minmax(260px,1fr)}}
@media(max-width:900px){.v5-chat-shell .chat-full,.v5-chat-shell .chat-full.profile-hidden{grid-template-columns:200px minmax(0,1fr)}}
.avatar-color-zelena{background:var(--avatar-zelena)}.avatar-color-modra{background:var(--avatar-modra)}.avatar-color-ruzova{background:var(--avatar-ruzova)}.avatar-color-fialova{background:var(--avatar-fialova)}.avatar-color-oranzova{background:var(--avatar-oranzova)}.avatar-color-tyrkys{background:var(--avatar-tyrkys)}
.avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.v5-profile-settings{max-width:480px}.v5-profile-settings form>label{margin-top:14px}.v5-profile-appearance{display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;margin-bottom:22px}.v5-profile-appearance>.avatar{width:88px;height:88px;font-size:33px}.v5-profile-appearance small{display:block;font-size:12px;margin-top:8px}.v5-avatar-colors{display:flex;gap:9px;justify-content:center;margin-top:12px}.v5-avatar-colors label{width:24px;height:24px;border-radius:50%;position:relative;cursor:pointer}.v5-avatar-colors input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.v5-avatar-colors label:has(:checked){outline:2px solid var(--inkoust);outline-offset:2px}.v5-avatar-colors label:has(:focus-visible){outline:2px solid var(--projekt-linka);outline-offset:3px}.v5-avatar-colors span{display:none}.v5-avatar-upload{display:inline-flex;gap:6px;align-items:center;padding:5px 10px;border:1px solid var(--linka);border-radius:8px;background:white;font-size:12px}.v5-avatar-crop canvas{display:block;width:256px;height:256px;margin:0 auto 14px;border-radius:6px;max-width:100%}.v5-avatar-crop label{display:block;margin-top:12px}

.chat-message-author{max-width:100%;min-width:0}.chat-message-author strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-message-author time,.chat-message-author i{flex-shrink:0}

.chat-notice form:focus-within{outline:2px solid var(--projekt-linka);outline-offset:1px}.chat-notice form input:focus{outline:0;box-shadow:none}

.chat-person-local-time{display:flex;align-items:center;justify-content:center;gap:5px;margin-top:8px;color:var(--text-3);font-size:12px}.chat-person-local-time .ui-icon{width:13px;height:13px}

@media(max-width:699px){#chat-dock.open{right:8px;bottom:12px;max-width:calc(100vw - 16px)}#chat-dock .chat-window{width:min(372px,calc(100vw - 16px));height:560px;max-height:calc(100dvh - 160px)}#chat-dock .chat-window.is-minimized{width:min(280px,calc(100vw - 16px));height:52px}#chat-dock .chat-bubbles{position:absolute;bottom:calc(100% + 8px);right:0;display:flex;flex-direction:row;max-width:100%;overflow-x:auto;padding:4px;gap:6px}#chat-dock .chat-bubble{flex:none}}
