
/* Karty zlecenia: pełna karta bez dymka, autor zawsze obok po lewej. */
.chat-panel .chat-order-cards .chat-entry {justify-content:flex-start;align-items:flex-start}
.chat-panel .chat-order-cards .chat-entry .chat-message {background:transparent;border:0;border-radius:0;box-shadow:none;padding:0;order:2}
.chat-panel .chat-order-cards .chat-entry .chat-message::after {display:none}
.chat-panel .chat-order-cards .chat-entry .chat-sender-avatar {order:1}
.chat-panel .chat-order-cards .chat-message > a {display:block;margin-bottom:8px}
.chat-panel .chat-order-cards .chat-message > a img {width:100%;height:auto;max-height:none;object-fit:contain;border-radius:0}
.chat-panel .chat-order-cards .chat-message > p:empty {display:none}
.chat-panel .chat-order-cards .chat-message .chat-original-link {font-size:12px}
.chat-card-draft {display:block;width:auto;max-width:100%;max-height:30dvh;object-fit:contain;margin:6px auto}
.vchat-release-footer {position:fixed;left:calc(12px + env(safe-area-inset-left,0px));bottom:max(3px,env(safe-area-inset-bottom,0px));font-size:10px;line-height:14px;color:#94a3b8;z-index:5;pointer-events:none}
.chat-card-refresh {display:block;text-align:center;color:#a7f3d0;font-size:13px;flex:none;min-height:20px}
.chat-card-refresh:empty {display:none}
.chat-order-cards {overscroll-behavior-y:contain}
.chat-panel .chat-order-cards .chat-entry .chat-message {flex:1;max-width:calc(100% - 50px);width:calc(100% - 50px)}
.chat-panel .chat-card-compose .chat-editor {background:transparent;border:0;box-shadow:none}
.chat-panel .chat-card-compose .chat-editor-right {display:none}
.chat-panel .chat-card-compose [hidden] {display:none!important}
.chat-panel .chat-card-delete {font-size:12px;padding:6px 12px;margin:0 0 12px}
.chat-draft-files {max-height:40dvh;overflow:auto;white-space:pre-line}
/* Wyszukiwarka w miejscu kompozytora: przewija się lista, nie dolne pole. */
.chat-panel [data-picker]:has(> .chat-object-header):not([hidden]) {display:flex;flex-direction:column;min-height:0;overflow:hidden;padding:0!important}
.chat-panel [data-picker]:has(> .chat-object-header) > .chat-object-list {flex:1 1 0;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 0}
.chat-panel [data-picker]:has(> .chat-object-header) > p {flex:none;margin:4px 0}
.chat-panel [data-picker]:has(> .chat-object-header) > p:empty {display:none}
.chat-panel [data-picker] > .chat-object-header {position:static;order:2;display:block;flex:0 0 auto;margin-top:6px;padding:0 0 max(4px,env(safe-area-inset-bottom));background:#111827}
.chat-panel [data-picker] > .chat-object-header input {box-sizing:border-box;width:100%;height:44px;margin:0;padding:9px 12px;font-size:16px;border-radius:12px}
.chat-panel .chat-object-entry,.chat-panel .chat-object-entry > button {background:transparent;border:0;box-shadow:none}
.chat-panel .chat-object-entry .chat-object-row {display:flex;align-items:center;gap:10px;text-align:left}
.chat-panel .chat-object-icon {display:inline-flex;flex:0 0 26px;width:26px;height:26px;color:#93c5fd}
.chat-panel .chat-object-icon svg {width:100%;height:100%}
.chat-panel .chat-object-label {min-width:0;flex:1;overflow-wrap:anywhere}
.chat-panel .chat-object-entry > button:focus-visible {outline:2px solid #93c5fd;outline-offset:-2px}
/* Pełna siatka również z galerii osadzonej obok czatu. */
body.chat-gallery-landscape > header {visibility:hidden;pointer-events:none}
dialog.chat-gallery-fullscreen {
  position:fixed;inset:0;width:100%;height:100dvh;max-width:none;max-height:none;
  margin:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing:border-box;border:0;border-radius:0;background:#0f172a;color:#f8fafc;overflow:auto;overscroll-behavior:contain;
}
dialog.chat-gallery-fullscreen::backdrop {background:#0f172a}
dialog.chat-gallery-fullscreen .chat-inline-gallery {
  display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:4px;
  align-content:start;width:100%;height:auto;max-height:none;overflow:visible;padding:4px;box-sizing:border-box;
}
dialog.chat-gallery-fullscreen .chat-inline-gallery button {margin:0;padding:0;min-width:0;min-height:0;aspect-ratio:1;border:0;border-radius:4px;overflow:hidden;background:#1e293b}
dialog.chat-gallery-fullscreen .chat-inline-gallery img {display:block;width:100%;height:100%;max-height:none;object-fit:contain}
/* vChat: szerokość ogranicza kontener, przewijanie wyłącznie listy. */
body.chat-active {overflow-x:hidden;overscroll-behavior-x:none}
.chat-panel,.chat-panel * {box-sizing:border-box}
.chat-panel {min-width:0;max-width:calc(100% - 24px)}
.chat-panel [data-picker],.chat-panel .chat-object-list,.chat-panel .chat-object-entry {min-width:0;max-width:100%;overflow-x:hidden}
.chat-panel [data-picker]:not([hidden]) {overflow-y:auto;touch-action:pan-y;overscroll-behavior:contain}
.chat-panel .chat-object-header {grid-template-columns:auto minmax(0,1fr);max-width:100%;flex:none}
.chat-panel .chat-object-header h3 {min-width:0;max-width:30vw;overflow-wrap:anywhere}
.chat-panel .chat-object-header input {min-width:0;width:100%}
.chat-panel .chat-object-header > button:last-child {grid-column:3;width:36px;min-width:0;margin:0;padding:0}
.chat-panel .chat-object-list {flex:none;min-height:auto;gap:6px;overflow:visible}
.chat-panel .chat-object-list > * {flex:none}
.chat-panel .chat-object-entry {display:grid;grid-template-columns:minmax(0,1fr) auto 40px;gap:4px;align-items:stretch;overflow:visible}
.chat-panel .chat-object-photo-count{align-self:center;background:none;border:0;padding:0;color:inherit;font-size:14px}
.chat-panel .chat-object-row>.chat-unread-badge{margin-left:0;flex:none}
.chat-panel .chat-object-list .chat-object-row {min-width:0;width:100%;height:auto;min-height:44px;margin:0;padding:9px 10px;font-size:15px;line-height:1.35;white-space:normal;overflow-wrap:anywhere}
.chat-panel .chat-object-gallery {width:40px;min-width:0;min-height:44px;height:auto;margin:0;padding:6px}
.chat-panel .chat-alert-settings-compact {flex:none;margin:0;padding:4px 0;font-size:12px}
.chat-panel .chat-alert-settings-compact[hidden] {display:none}
.chat-alert-settings-compact h3,.chat-alert-settings-compact .actions {display:none}
.chat-alert-settings-compact p {margin:3px 0}
.chat-alert-settings-compact button {margin:0;min-height:36px;font-size:13px}
.chat-panel .vchat-search-actions {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;flex:none;padding:5px 0 max(5px,env(safe-area-inset-bottom));background:#111827}
.chat-panel .vchat-search-actions[hidden] {display:none!important}
.chat-panel .vchat-search-actions button {display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;margin:0;min-height:46px;padding:8px 5px;border:1px solid #475569;border-radius:12px;background:linear-gradient(160deg,#28384f,#182334);box-shadow:inset 0 1px 0 #ffffff0d;color:#f1f5f9;font-size:14px;font-weight:600;line-height:1.2}
.chat-panel .vchat-search-actions button:active {background:#334155;transform:translateY(1px)}
.chat-panel .vchat-search-actions button:disabled {opacity:.45}
.chat-panel .vchat-menu-icon {display:inline-flex;flex:0 0 22px;width:22px;height:22px;color:#93c5fd}
.chat-panel .vchat-menu-icon svg {width:100%;height:100%}
.chat-panel.chat-browse-active > .chat-people {display:none!important}
.chat-panel .chat-object-list .chat-contact-row {display:flex;align-items:center;gap:10px;background:transparent;border:0;border-radius:8px;padding:8px 5px;min-height:46px;text-align:left;box-shadow:none}
.chat-panel .chat-object-list .chat-contact-row:is(:active,:focus-visible) {background:#ffffff0b}
.chat-panel .chat-contact-row .chat-avatar {margin:0;width:32px;height:32px;flex:0 0 32px}
.chat-panel .chat-contact-row .vchat-menu-icon {width:32px;height:32px;flex-basis:32px;padding:4px}
.chat-panel .chat-people .chat-person {flex-direction:row;min-width:0;gap:6px;height:40px;white-space:nowrap;background:transparent}
.chat-panel .chat-people {height:46px;flex-basis:46px}
.chat-panel .chat-compose {padding-bottom:0}
.vchat-launcher {display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
body>header .vchat-launcher {grid-row:2;grid-column:3;justify-self:end;padding:4px 10px;font-size:12px}
.vchat-install-dialog {width:min(92vw,440px);max-height:90dvh;overflow-y:auto;box-sizing:border-box}
.vchat-install-dialog input {width:100%;min-width:0;box-sizing:border-box}
.vchat-install-dialog .actions {display:flex;gap:8px;flex-wrap:wrap}
.vchat-install-dialog li {margin:10px 0}
/* Menu konta: profil / wyloguj, poniżej uprawnienia / instalacja vChat. */
#account .vm-account-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:1fr;gap:8px}
#account .vm-account-actions > button {box-sizing:border-box;width:100%;min-width:0;min-height:60px;height:100%;margin:0;padding:8px;font-size:14px;line-height:1.25;white-space:normal;overflow-wrap:anywhere}
#account .vm-account-actions > button[hidden] {display:none}
#account .vm-account-actions > button:last-child {grid-column:2}
#account .vm-account-actions > .vm-account-placeholder {opacity:1;cursor:default;background:transparent;box-shadow:none}
/* Ukrycie wizualne zależy od istniejącego stanu menu, bez resetowania kafelków/praw. */
body:not([data-app="vchat"]):has(#account:not([hidden])) .panel-programs {display:none!important}
.chat-panel .chat-site-heading {display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none}
.chat-panel .chat-site-heading h3 {min-width:0;overflow-wrap:anywhere;margin:4px 0}
.chat-panel .chat-site-heading .chat-object-gallery {flex:0 0 40px}
.chat-panel.card.chat-gallery-active {left:0;right:0;max-width:100%;width:100%}
.chat-panel.chat-gallery-active > .chat-people,.chat-panel.chat-gallery-active > .vchat-search-actions,.chat-panel.chat-gallery-active > .chat-alert-settings-compact {display:none!important}
.chat-panel.chat-gallery-active [data-picker] {padding:0 4px;touch-action:pan-y}
.chat-panel.chat-gallery-active .chat-inline-gallery {align-content:start;overflow:visible;gap:4px}
.chat-panel.chat-gallery-active .chat-inline-gallery button {margin:0;min-height:0}
.chat-panel.chat-gallery-active .chat-inline-gallery img {height:auto;aspect-ratio:1;object-fit:contain}
dialog.chat-photo-viewer {z-index:20;bottom:auto;left:0;right:0;max-width:100%;width:100%;max-height:none}
dialog.chat-photo-viewer .chat-photo-stage {inset:0}
dialog.chat-photo-viewer .chat-photo-status {top:auto;bottom:max(6px,env(safe-area-inset-bottom));left:50%;right:auto;transform:translateX(-50%);padding:2px 6px;border-radius:4px;background:#080e1899}
/* Poziomy podgląd zdjęcia bez nagłówka aplikacji i bez przycisku Back. */
body.chat-photo-landscape > header {visibility:hidden;pointer-events:none}
body.chat-photo-landscape .chat-photo-viewer .chat-photo-close {display:none!important}
body.chat-photo-landscape .chat-photo-viewer {left:0;right:0;width:100%;max-width:100%;max-height:none}
.chat-panel [data-employee-list]{display:flex;flex-direction:column;gap:8px;overflow:auto;min-height:0;flex:1}
.chat-panel [data-employee-list] .chat-person{position:relative;flex-direction:row;width:100%;min-height:51px;height:auto;gap:10px;text-align:left;justify-content:flex-start;padding:6px}
.chat-panel [data-employee-list] .chat-person>span:not(.chat-avatar){font-size:70%}
.chat-panel [data-employee-list] .chat-avatar{width:39.2px;height:39.2px;font-size:19.6px;margin:0;flex:0 0 39.2px}
.chat-panel .chat-layout{flex-direction:row;gap:8px}
.chat-panel [data-employee-list]{min-width:0;max-height:none}
.chat-panel .chat-layout>[data-people]{flex:0 0 92px;flex-direction:column;justify-content:flex-start;align-items:stretch;height:auto;max-height:none;min-height:0;margin:0;padding:0;overflow-x:hidden;overflow-y:auto}
.chat-panel .chat-layout>[data-people]:empty{display:none}
.chat-panel .chat-layout>[data-people] .chat-person{flex:none;flex-direction:column;width:100%;height:auto;min-height:64px;white-space:normal;text-align:center;justify-content:center;padding:6px 2px}
.chat-panel .chat-unread-badge{margin-left:auto;background:#06953f;color:white;border-radius:16px;padding:4px 9px;min-width:24px;text-align:center}
.chat-panel [data-unread]{display:flex;flex-direction:column;gap:5px;max-height:30vh;overflow:auto;flex:none}
.chat-panel [data-unread] button{text-align:left;border-left:4px solid #06953f}
.chat-panel.chat-room-open [data-employee-list],.chat-panel.chat-room-open [data-unread]{display:none}
.chat-panel:not(.chat-room-open) [data-conversation]:empty{display:none}
.chat-panel .chat-object-row.has-unread{border-left:4px solid #06953f;font-weight:700}
/* Rozmowa zajmuje całą szerokość; grupy wracają po wyjściu do listy. */
.chat-panel.chat-room-open .chat-layout>[data-people]{display:none}
.chat-panel .chat-compose .chat-editor textarea:focus{outline:none;background:transparent}
.chat-panel .chat-compose .chat-editor:focus-within{border-color:#94a3b8;box-shadow:none}
/* Licznik przy awatarze, przed nazwiskiem, także przy zawijaniu nazwy. */
.chat-panel [data-employee-list] .chat-person>.chat-avatar{order:0}
.chat-panel [data-employee-list] .chat-person>.chat-unread-badge{order:1;margin-left:0;flex:none}
.chat-panel [data-employee-list] .chat-person>span:not(.chat-avatar){order:2;min-width:0}
/* Nazwa prywatnego rozmówcy dostępna dla czytnika, bez paska nad wiadomościami. */
.chat-panel .chat-private-conversation>h3{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.chat-panel.chat-room-open>.vchat-search-actions{display:none!important}
.vchat-about{width:min(90vw,360px);max-height:80dvh;overflow:auto;border:1px solid #64748b;border-radius:16px;background:#111827;color:#f1f5f9;padding:20px}
.vchat-about::backdrop{background:#0008}
.vchat-about h2{margin-top:0}
.vchat-about .actions{display:flex;gap:8px}
body[data-app="vchat"] header [role="button"]{cursor:pointer}
body[data-app="vchat"] header [role="button"]:focus-visible{outline:2px solid #94a3b8;outline-offset:4px}
