/* Members chat (/chat/): a light room card under the page banner, in the site's lavender / white / indigo. Law: buttons 44px+, one line. */
.pg-head + .tcn-chat-page { padding: 56px 16px 112px; display: flex; justify-content: center; }
@media (max-width: 520px) { .pg-head + .tcn-chat-page { padding: 24px 12px 88px; } }
.tcn-chat { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 820px; overflow: hidden; border-radius: 20px; background: #fff; box-shadow: 0 18px 44px rgba(27, 26, 99, .18); font-family: var(--dp-sans, Inter, sans-serif); }
.tcn-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; background: linear-gradient(135deg, #1b1a63 0%, #313de0 58%, #6b2fa0 100%); color: #fff; }
.tcn-chat-head h2 { margin: 0; color: #fff; font: 800 18px/1.2 var(--dp-sans); text-transform: none; letter-spacing: 0; }
.tcn-chat-online { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; font: 700 13px/1 var(--dp-sans); white-space: nowrap; }
.tcn-chat-online i { width: 8px; height: 8px; border-radius: 50%; background: #5eead4; animation: tcnChatPulse 2s infinite; }
.tcn-chat-online b { font-weight: 800; }
@keyframes tcnChatPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.tcn-chat-msgs { display: flex; flex-direction: column; gap: 2px; min-height: 360px; max-height: 58vh; overflow-y: auto; padding: 18px 20px; background: #f6f4fd; scroll-behavior: smooth; }
.tcn-chat-msg { position: relative; display: flex; gap: 12px; padding: 8px 10px; border-radius: 14px; animation: tcnChatIn .25s ease; }
.tcn-chat-msg:hover { background: rgba(49, 61, 224, .05); }
@keyframes tcnChatIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tcn-chat-av { flex: none; display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border: 2px solid var(--uc, #0d9488); border-radius: 50%; background: #fff; color: var(--uc, #0d9488); font: 800 12px/1 var(--dp-sans); text-transform: uppercase; }
.tcn-chat-av img { width: 100%; height: 100%; object-fit: cover; }
.tcn-chat-body { flex: 1; min-width: 0; }
.tcn-chat-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.tcn-chat-meta b { color: color-mix(in srgb, var(--uc, #0d9488) 65%, #1b1a63); font: 800 14px/1.2 var(--dp-sans); }
.tcn-chat-meta time { color: #7a7f93; font: 600 12px/1 var(--dp-sans); }
.tcn-chat-text { color: #1b1c2e; font: 500 15px/1.5 var(--dp-sans); overflow-wrap: anywhere; }
.tcn-chat-msg.is-grouped { padding-top: 0; }
.tcn-chat-msg.is-grouped .tcn-chat-av { visibility: hidden; height: 0; border: 0; }
.tcn-chat-msg.is-grouped .tcn-chat-meta { display: none; }
.tcn-chat-del { position: absolute; top: 0; right: 4px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: #7a7f93; font-size: 22px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s; }
.tcn-chat-msg:hover .tcn-chat-del, .tcn-chat-del:focus-visible { opacity: 1; }
.tcn-chat-del:hover { color: #a8281c; }
.tcn-chat-new { align-self: center; margin: -52px 0 8px; z-index: 2; display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: #313de0; color: #fff; font: 800 14px/1 var(--dp-sans); white-space: nowrap; box-shadow: 0 8px 22px rgba(49, 61, 224, .35); cursor: pointer; }
.tcn-chat-new[hidden] { display: none; }

.tcn-chat-bar { position: relative; padding: 14px 18px 18px; border-top: 1px solid #e4e0f4; background: #fff; }
.tcn-chat-field { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 8px 6px 6px; border: 1.5px solid #d9d4f0; border-radius: 999px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.tcn-chat-field:focus-within { border-color: #313de0; box-shadow: 0 0 0 3px rgba(49, 61, 224, .14); }
.tcn-chat-color { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.tcn-chat-color:hover { background: rgba(49, 61, 224, .08); }
.tcn-chat-color span { width: 22px; height: 22px; border-radius: 50%; background: #0d9488; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #cfd3dc; }
#tcn-input { flex: 1; min-width: 0; height: 44px; padding: 0 4px; border: 0; background: transparent; color: #1b1c2e; font: 500 16px/1 var(--dp-sans); outline: 0; }
#tcn-input::placeholder { color: #9a9fb2; }
.tcn-chat-count { min-width: 28px; color: #9a9fb2; font: 700 12px/1 var(--dp-sans); text-align: right; }
.tcn-chat-count.is-warn { color: #a8281c; }
.tcn-chat-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: linear-gradient(135deg, #1b1a63, #313de0 60%, #6b2fa0); color: #fff; cursor: pointer; transition: transform .15s; }
.tcn-chat-send:hover { transform: scale(1.06); }
.tcn-chat-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.tcn-chat-palette { position: absolute; left: 18px; right: 18px; bottom: calc(100% - 6px); padding: 16px; border: 1px solid #e4e0f4; border-radius: 18px; background: #fff; box-shadow: 0 -10px 34px rgba(27, 26, 99, .18); }
.tcn-chat-palette[hidden] { display: none; }
.tcn-chat-palette-label { margin-bottom: 12px; color: #4a5160; font: 800 12px/1 var(--dp-sans); letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.tcn-chat-palette-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; justify-items: center; }
.tcn-chat-swatch { width: 100%; max-width: 44px; aspect-ratio: 1; min-height: 32px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1.5px #d9d4f0; cursor: pointer; }
.tcn-chat-swatch.is-on { box-shadow: 0 0 0 3px #313de0; }
@media (max-width: 520px) { .tcn-chat-msgs { min-height: 300px; max-height: 62vh; padding: 12px; } .tcn-chat-palette-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tcn-chat-swatch { min-height: 44px; } }
