.admin-chat { position: fixed; right: 22px; bottom: var(--admin-chat-bottom, 100px); z-index: 45; font-family: inherit; color: var(--ink); }
.admin-chat-launcher { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; margin-bottom: 12px; padding: 12px 18px; border: 1px solid #355b4b; border-radius: 16px; background: #244c40; color: white; font-size: .8rem; font-weight: 600; box-shadow: 0 5px 22px #152b3526; }
.admin-chat-launcher:hover { background: #1a3c32; }
.admin-chat-online-badges { position: absolute; right: 10px; bottom: -18px; display: flex; gap: 4px; }
.admin-chat-online-badge { display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px; border: 2px solid white; border-radius: 50%; background: #deeee3; color: #244c40; box-shadow: 0 2px 5px #152b3526; font-size: .56rem; line-height: 1; font-weight: 700; }
.admin-chat-launcher-copy { display: grid; gap: 2px; text-align: left; }
.admin-chat-launcher-copy strong { font: inherit; }
.admin-chat-launcher-project { display: block; max-width: min(280px,calc(100vw - 130px)); color: #e0eee4; font-size: .72rem; font-weight: 500; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.admin-chat-presence { color: #c6dece; font-size: .6875rem; font-weight: 400; line-height: 1.3; }
.admin-chat-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: #f0c4a5; color: #3c352d; font-size: .7rem; font-variant-numeric: tabular-nums; }
.admin-chat.is-offline .admin-chat-launcher { border-color: #c4976c; }
.admin-chat-panel { display: flex; flex-direction: column; width: 410px; max-width: calc(100vw - 32px); height: var(--admin-chat-height, 560px); border: 1px solid #cbd8d0; border-radius: 18px; background: #f6f8f5; overflow: hidden; box-shadow: 0 14px 60px #132b3540, 0 3px 12px #132b3514; }
.admin-chat-header { position: relative; flex-shrink: 0; padding: 8px 14px 4px; border-bottom: 1px solid #d6e1d9; background: #e6f0e8; }
.admin-chat-header-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-chat-header-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; color: #6b8067; font-size: .6875rem; line-height: 1.4; }
.admin-chat-header-note { flex: 1; min-width: 0; }
.admin-chat-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.admin-chat-header h2 { margin: 4px 0 0; font-size: 1.1rem; letter-spacing: -.025em; }
.admin-chat-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-chat-title-row h2 { margin: 0; white-space: nowrap; }
.admin-chat-title-row > svg { flex: none; width: 19px; height: 19px; }
.admin-chat-project-context { margin: 5px 0 0; color: #244c40; font-size: .78rem; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.admin-chat-stars-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 5px; min-width: 49px; min-height: 44px; padding: 7px; border: 0; border-radius: 9px; background: transparent; color: #53674f; font-size: .6875rem; font-variant-numeric: tabular-nums; }
.admin-chat-stars-button > span:first-child { color: #96742d; font-size: 1.15rem; }
.admin-chat-stars-button:hover, .admin-chat-stars-button[aria-pressed="true"] { background: #d8e6d8; }
.admin-chat-header-actions { display: flex; align-items: center; flex-shrink: 0; gap: 6px; }
.admin-chat-menu { position: relative; }
.admin-chat-menu summary { display: grid; place-items: center; width: 44px; min-height: 44px; border-radius: 10px; color: #42614e; cursor: pointer; font-size: 1.5rem; line-height: 1; list-style: none; }
.admin-chat-menu summary::-webkit-details-marker { display: none; }
.admin-chat-menu[open] summary, .admin-chat-menu summary:hover { background: #d3e2d5; }
.admin-chat-menu-body { position: absolute; top: calc(100% + 5px); right: 0; z-index: 3; width: 205px; max-width: calc(100vw - 48px); padding: 6px; border: 1px solid #d5dfd4; border-radius: 10px; background: white; box-shadow: 0 5px 20px #1d352522; }
.admin-chat-sound { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px; font-size: .75rem; cursor: pointer; }
.admin-chat-sound input { width: 18px; height: 18px; margin: 0; accent-color: #496d55; }
.admin-chat-sound strong { font-weight: 600; }
.admin-chat-sound-note { display: block; margin-top: 3px; color: #73836d; font-size: .6875rem; line-height: 1.5; }
.admin-chat-sound-retry { width: 100%; min-height: 44px; padding: 8px; border: 0; border-radius: 7px; background: #eef5eb; color: #41644a; font-size: .75rem; }
.admin-chat-clear { width: 100%; min-height: 44px; padding: 9px 12px; border: 0; border-radius: 7px; background: #fff8f5; color: #934e43; text-align: left; font-size: .75rem; font-weight: 600; }
.admin-chat-close { display: inline-grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid #cbdad0; border-radius: 10px; background: #f7faf6; color: #37574a; font-size: 1.65rem; line-height: 1; }
.admin-chat-close:hover { background: white; }
.admin-chat-members { position: relative; flex-shrink: 0; max-width: 47%; color: #4b695b; }
.admin-chat-members summary { display: flex; align-items: center; justify-content: flex-end; gap: 4px; max-width: 100%; min-height: 44px; padding: 6px 0 6px 6px; cursor: pointer; list-style: none; text-align: right; overflow-wrap: anywhere; }
.admin-chat-members summary::-webkit-details-marker { display: none; }
.admin-chat-members summary > span:last-child { flex-shrink: 0; }
.admin-chat-member-list { position: absolute; z-index: 4; top: 100%; right: 0; width: min(300px,calc(100vw - 56px)); max-height: max(60px,min(180px,calc(var(--admin-chat-height,560px) - 112px))); overflow: auto; margin: 0; padding: 12px 14px; border: 1px solid #d4dfcd; border-radius: 9px; background: white; box-shadow: 0 5px 20px #1d352522; line-height: 1.8; overflow-wrap: anywhere; }
.admin-chat-member-list h3 { margin: 0 0 6px; color: #53705d; font-size: .6875rem; font-weight: 600; }
.admin-chat-member-list h3:not(:first-child) { margin-top: 12px; }
.admin-chat-member-group { margin: 0; padding-left: 16px; }
.admin-chat-member-empty, .admin-chat-member-status { margin: 0; color: #7c8978; font-size: .6875rem; line-height: 1.6; }
.admin-chat-member-name { display: block; }
.admin-chat-member-email, .admin-chat-author-email { display: block; color: #6e7e70; font-size: .6875rem; font-weight: 400; line-height: 1.5; }
.admin-chat-member-list li + li { margin-top: 6px; }
.admin-chat-author-lines { min-width: 0; }
.admin-chat-connection { flex-shrink: 0; margin: 0; padding: 9px 16px; border-bottom: 1px solid #e5dfd1; background: #faf4e8; color: #83643e; font-size: .6875rem; line-height: 1.6; }
.admin-chat-connection button { min-height: 44px; padding: 0 5px; border: 0; background: transparent; color: inherit; font-weight: 600; text-decoration: underline; }
.admin-chat-room { position: relative; display: flex; flex: 1; min-height: 0; }
.admin-chat-new-dot { position: absolute; z-index: 2; right: 10px; bottom: 8px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 2px solid white; border-radius: 50%; background: #287046; color: white; box-shadow: 0 3px 12px #173d3a40; cursor: pointer; }
.admin-chat-new-dot:hover { background: #1d5935; }
.admin-chat-new-dot > svg { width: 24px; height: 24px; color: white; animation: admin-chat-new-pulse 1.8s ease-in-out infinite; }
@keyframes admin-chat-new-pulse { 0%, 100% { opacity: .65; transform: translateY(-1px); } 50% { opacity: 1; transform: translateY(1px); } }
.admin-chat-new-dot:focus-visible { outline: 2px solid #173e29; outline-offset: 3px; }
.admin-chat-history { flex: 1; min-height: 0; padding: 14px 16px 18px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; overflow-anchor: none; }
.admin-chat-older { display: block; min-height: 44px; margin: 0 auto 8px; padding: 8px 12px; border: 1px solid #d9e2d9; border-radius: 9px; background: white; color: #4b6a5d; font-size: .7rem; font-weight: 600; }
.admin-chat-empty { margin: 30px 12px; color: #7c8d83; font-size: .77rem; line-height: 1.8; text-align: center; }
.admin-chat-day { display: flex; align-items: center; gap: 10px; margin: 15px 0; color: #829087; font-size: .6875rem; text-align: center; }
.admin-chat-day::before, .admin-chat-day::after { content: ""; flex: 1; height: 1px; background: #e0e7df; }
.admin-chat-day span { flex-shrink: 0; }
.admin-chat-message-row { margin-bottom: 10px; }
.admin-chat-message { margin: 0 22px 0 0; padding: 12px 13px; border: 1px solid #e1e7de; border-radius: 12px 12px 12px 3px; background: white; }
.admin-chat-message.is-own { margin-right: 0; margin-left: 22px; border-color: #d5e3d7; border-radius: 12px 12px 3px 12px; background: #eaf3e9; }
.admin-chat-seen { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; margin: 4px 22px 0 2px; color: #85907f; font-size: .6875rem; line-height: 1.5; }
.admin-chat-message-row.is-own .admin-chat-seen { justify-content: flex-end; margin-right: 2px; margin-left: 22px; }
.admin-chat-readers { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.admin-chat-reader { color: #677e67; font-weight: 600; cursor: help; }
.admin-chat-credit { flex-shrink: 0; margin: 0; padding: 2px 12px 4px; color: #899486; font-size: 10px; line-height: 14px; text-align: center; }
.admin-chat-message-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.admin-chat-author { min-width: 0; color: #60776a; font-size: .6875rem; font-weight: 600; overflow-wrap: anywhere; }
.admin-chat-message time { flex-shrink: 0; color: #8a978d; font-size: .6875rem; font-variant-numeric: tabular-nums; }
.admin-chat-body { margin: 0; font-size: .77rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-chat-message.is-starred { border-color: #d9cda4; }
.admin-chat-message-tools { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px 8px; margin: 6px 0 -5px; }
.admin-chat-message-tools .admin-chat-delete { margin: 0 0 0 auto; }
.admin-chat-message-stamp { display: grid; justify-items: end; gap: 2px; flex-shrink: 0; }
.admin-chat-edited { color: #748270; font-size: .6875rem; line-height: 1.4; }
.admin-chat-edit, .admin-chat-delete { display: grid; place-items: center; flex-shrink: 0; width: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: 8px; background: transparent; }
.admin-chat-edit { color: #667b62; }
.admin-chat-edit:hover { background: #edf2e9; }
.admin-chat-star { display: grid; place-items: center; flex-shrink: 0; width: 44px; min-height: 44px; padding: 5px; border: 0; border-radius: 8px; background: transparent; color: #7a8978; font-size: 1.35rem; }
.admin-chat-star.is-starred { color: #916c21; background: #fbf3d8; }
.admin-chat-star:hover { background: #edf2e9; }
.admin-chat-reaction-picker { flex-shrink: 0; width: 44px; }
.admin-chat-reaction-trigger { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 8px; border: 0; border-radius: 0; background: transparent; color: #7c877e; cursor: pointer; }
.admin-chat-reaction-trigger:hover, .admin-chat-reaction-trigger[aria-expanded="true"] { background: #edf2e9; }
.admin-chat-reaction-choices { position: fixed; z-index: 160; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); box-sizing: border-box; margin: 0; padding: 4px; border: 1px solid #d5dfd4; border-radius: 6px; background: #fff; color: var(--ink); box-shadow: 0 5px 20px #1d35252b; }
.admin-chat-reaction-choices button { min-width: 0; width: 100%; min-height: 44px; padding: 2px 0; border: 0; border-radius: 0; background: transparent; font-size: 1.3rem; }
.admin-chat-reaction-choices button:hover, .admin-chat-reaction-choices [aria-pressed="true"] { background: #dcebd6; }
.admin-chat-reactions { display: flex; flex-wrap: nowrap; gap: 8px; max-width: 100%; margin-top: 4px; overflow-x: auto; }
.admin-chat-reaction { flex-shrink: 0; min-height: 44px; padding: 4px 2px; border: 0; border-radius: 0; background: transparent; color: #63715e; font-size: .8rem; font-variant-numeric: tabular-nums; }
.admin-chat-reaction.is-own { color: #416838; font-weight: 600; }
.admin-chat-reaction:hover { background: #edf2e9; }
.admin-chat-stars-intro { flex-shrink: 0; padding: 0 16px 10px; border-bottom: 1px solid #dce5d8; }
.admin-chat-stars-back { min-height: 44px; padding: 9px 0; border: 0; background: transparent; color: #466c4f; font-size: .75rem; font-weight: 600; }
.admin-chat-stars-intro h3 { margin: 2px 0 5px; font-size: .95rem; }
.admin-chat-stars-intro p { margin: 0; color: #718369; font-size: .6875rem; line-height: 1.5; }
.admin-chat-stars-pages { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.admin-chat-stars-pages button { min-height: 44px; padding: 8px; border: 1px solid #d7e2d1; border-radius: 8px; background: white; color: #4e6c4d; font-size: .6875rem; }
.admin-chat-stars-pages span { color: #7a8972; font-size: .6875rem; }
.admin-chat-typing { display: flex; align-items: center; flex-shrink: 0; gap: 10px; min-height: 36px; padding: 4px 16px 9px; color: #6e8068; font-size: .6875rem; line-height: 1.5; }
.admin-chat-typing-dots { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; gap: 4px; padding: 9px 11px; border: 1px solid #dae4d4; border-radius: 16px; background: #eaf1e4; }
.admin-chat-typing-dots::before, .admin-chat-typing-dots::after { content: ""; position: absolute; border-radius: 50%; background: #d6e2cd; }
.admin-chat-typing-dots::before { width: 5px; height: 5px; bottom: -3px; left: 8px; }
.admin-chat-typing-dots::after { width: 3px; height: 3px; bottom: -7px; left: 4px; }
.admin-chat-typing-dots > span { width: 5px; height: 5px; border-radius: 50%; background: #708865; animation: admin-chat-typing-pulse 1.2s ease-in-out infinite; }
.admin-chat-typing-dots > span:nth-child(2) { animation-delay: .16s; }
.admin-chat-typing-dots > span:nth-child(3) { animation-delay: .32s; }
@keyframes admin-chat-typing-pulse { 0%, 70%, 100% { opacity: .4; transform: translateY(1px); } 35% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .admin-chat-typing-dots > span { animation: none; opacity: .8; transform: none; } .admin-chat-new-dot > svg { animation: none; opacity: 1; transform: none; } }
.admin-chat-compose { flex-shrink: 0; margin: 0; padding: 12px 14px 10px; border-top: 1px solid #dce5da; background: white; }
.admin-chat-compose-row { display: flex; align-items: flex-end; gap: 9px; }
.admin-chat-input { flex: 1; min-width: 0; min-height: 70px; max-height: 130px; padding: 10px 12px; border: 1px solid #d3dfd1; border-radius: 10px; background: #fcfdfb; color: var(--ink); font-size: .76rem; line-height: 1.6; resize: vertical; }
.admin-chat-input::placeholder { color: #94a092; }
.admin-chat .admin-chat-send { min-width: 60px; min-height: 44px; padding-inline: 12px; }
.admin-chat-compose-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; color: #7f8c79; font-size: .6875rem; }
.admin-chat-compose-hint span:last-child { font-variant-numeric: tabular-nums; }
.admin-chat-send-error { margin: 8px 0 0; color: #9d4b4d; font-size: .6875rem; line-height: 1.6; }
.admin-chat-moderation-error { flex-shrink: 0; margin: 0; padding: 10px 16px; border-bottom: 1px solid #edddd3; background: #fff6f0; color: #8b5548; font-size: .6875rem; line-height: 1.6; }
.admin-chat-delete { color: #8b6458; }
.admin-chat-delete:hover { background: #f6ece6; }
.admin-chat-edit-dialog { width: min(440px,calc(100vw - 28px)); max-height: calc(100dvh - 28px); margin: auto; padding: 22px; border: 1px solid #cbd8d0; border-radius: 14px; background: #fbfdf9; color: var(--ink); box-shadow: 0 15px 70px #18352833; overflow: auto; }
.admin-chat-edit-dialog::backdrop { background: #172b3555; }
.admin-chat-edit-form { display: grid; gap: 12px; }
.admin-chat-edit-form h3 { margin: 0; font-size: 1.1rem; }
.admin-chat-edit-hint { margin: 0; color: #71836a; font-size: .75rem; line-height: 1.6; }
.admin-chat-edit-input { width: 100%; min-height: 150px; max-height: 50vh; padding: 12px; border: 1px solid #cbdac4; border-radius: 8px; background: white; color: var(--ink); font: inherit; font-size: .85rem; line-height: 1.7; resize: vertical; }
.admin-chat-edit-error { margin: 0; color: #9b554a; font-size: .75rem; line-height: 1.6; }
.admin-chat-edit-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.admin-chat-edit-dialog .btn { min-height: 44px; }
.admin-chat.is-compact .admin-chat-header { padding-block: 4px; }
.admin-chat.is-compact .admin-chat-input { min-height: 44px; max-height: 76px; }
.admin-chat.is-compact .admin-chat-history { padding-block: 8px; }
@media (max-width: 680px) {
  .admin-chat { right: 12px; }
  .admin-chat-panel { width: calc(100vw - 24px); max-width: none; border-radius: 15px; }
  .admin-chat-launcher { min-height: 48px; padding: 10px 14px; border-radius: 14px; font-size: .75rem; }
  .admin-chat-header { padding-inline: 12px; }
  .admin-chat-history { padding-inline: 12px; }
  .admin-chat-input { font-size: 16px; }
  .admin-chat-edit-input { font-size: 16px; }
  .admin-chat-message { margin-right: 14px; }
  .admin-chat-message.is-own { margin-left: 14px; margin-right: 0; }
}

/* Project identity is visible in both chat states; controls retain 44px targets. */
.admin-chat-header-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-chat button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 380px) {
  .admin-chat-header-main, .admin-chat-title-row { gap: 4px; }
  .admin-chat-header-actions { gap: 2px; }
  .admin-chat-header h2 { font-size: .95rem; }
}
