.chat-layout {
 display:grid; grid-template-columns:minmax(215px, 300px) minmax(0, 1fr);
 min-height:410px; height:min(70dvh, 780px);
 border:1px solid #d6e2ed; border-radius:16px; overflow:hidden;
 background:#fff; color:#1e3853;
}
.chat-sidebar,.chat-conversation { min-height:0; min-width:0; display:flex; flex-direction:column; }
.chat-sidebar { border-inline-end:1px solid #d6e2ed; padding:12px; gap:10px; }
.chat-tabs { display:flex; gap:6px; }
.chat-tabs a { flex:1; text-align:center; padding:10px 3px; border-radius:8px; }
.chat-tabs [aria-current] { background:#e6f1fc; font-weight:700; color:#224e7e; }
.chat-list,.chat-history { min-height:0; overflow:auto; }
.chat-list { flex:1; }
.chat-contact-group h3 { margin:12px 8px 5px; font-size:.79rem; color:#526980; }
.chat-item { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:11px 9px; border-radius:9px; color:inherit; min-height:44px; }
.chat-item:hover,.chat-item[aria-current] { background:#eaf2fb; }
.chat-item-text { min-width:0; }
.chat-item strong,.chat-item small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-item small:empty { display:none; }
.chat-item small { margin-top:3px; color:#526980; }
.chat-count { flex-shrink:0; background:#285c91; color:white; font-size:.76rem; font-weight:700; border-radius:20px; min-width:24px; text-align:center; padding:2px 6px; }
.chat-thread-head { display:flex; align-items:center; gap:12px; padding:10px 16px; border-bottom:1px solid #d6e2ed; }
.chat-thread-head h2 { font-size:1rem; margin:0; overflow-wrap:anywhere; }
.chat-thread-head small { color:#526980; }
.chat-back { display:none; }
.chat-history { position:relative; flex:1; display:flex; flex-direction:column; gap:10px; background:#f1f6fc; padding:16px; }
.chat-bubble { padding:10px 14px; border-radius:13px 13px 13px 3px; background:#fff; align-self:flex-start; max-width:85%; overflow-wrap:anywhere; }
.chat-bubble.own { align-self:flex-end; background:#daebff; border-radius:13px 13px 3px 13px; }
.chat-bubble p { margin:0; white-space:pre-wrap; }
.chat-bubble strong { display:block; color:#285c91; margin-bottom:3px; font-size:.83rem; }
.chat-bubble small { display:block; text-align:end; margin-top:4px; color:#526980; font-size:.72rem; }
.chat-placeholder { color:#526980; margin:auto; padding:12px; text-align:center; }
.chat-compose { position:relative; display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:center; padding:10px 12px; gap:6px 10px; border-top:1px solid #d6e2ed; }
.chat-compose.has-stickers { grid-template-columns:auto minmax(0, 1fr) auto; }
.chat-text-label { min-width:0; }
.chat-text-label textarea { display:block; width:100%; min-height:54px; max-height:120px; resize:vertical; }
.chat-sticker-menu summary { display:grid; place-items:center; width:44px; height:44px; border:1px solid transparent; border-radius:12px; color:#315e8d; cursor:pointer; list-style:none; }
.chat-sticker-menu summary::-webkit-details-marker { display:none; }
.chat-sticker-menu summary svg { width:25px; height:25px; }
.chat-sticker-menu[open] summary,.chat-sticker-menu summary:hover,.chat-sticker-choice:hover { background:#e7f0fa; }
.chat-sticker-menu :is(summary,button,select):focus-visible { outline:2px solid #3573ac; outline-offset:-2px; }
.chat-sticker-panel { position:absolute; z-index:4; left:6px; right:6px; bottom:100%; max-width:388px; display:grid; gap:8px; padding:12px; border:1px solid #cddeec; border-radius:16px; background:#fff; box-shadow:0 6px 24px #17355229; }
.chat-sticker-panel label { display:grid; gap:4px; min-width:0; color:inherit; font-size:.78rem; font-weight:600; }
.chat-sticker-panel select { width:100%; min-width:0; }
.chat-sticker-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(62px,1fr)); gap:4px; max-height:min(30dvh,235px); overflow-y:auto; overscroll-behavior:contain; }
.chat-sticker-choice { margin:0; padding:2px; width:100%; min-height:44px; aspect-ratio:1; border:0; border-radius:9px; background:transparent; cursor:pointer; }
.chat-sticker-choice img { width:100%; height:100%; display:block; object-fit:contain; }
.chat-layout .chat-bubble.with-sticker { padding:0; background:transparent; }
.chat-art { display:block; width:min(164px,100%); height:auto; aspect-ratio:1; object-fit:contain; }
.chat-bubble.with-sticker small { width:fit-content; margin-inline-start:auto; padding:1px 6px; border-radius:7px; background:#ffffffbd; }
.chat-compose [data-error] { grid-column:1/-1; margin:0; }
.chat-compose [data-error]:empty { display:none; }
.chat-layout [hidden] { display:none; }
.chat-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media(max-width:760px){
 .chat-layout { display:flex; flex-direction:column; min-height:320px; height:58dvh; }
 .chat-conversation,.chat-sidebar { flex:1; }
 .chat-layout:not(.has-thread) .chat-conversation,.chat-layout.has-thread .chat-sidebar { display:none; }
 .chat-back { display:inline; flex-shrink:0; }
 .chat-bubble { max-width:93%; }
 .chat-compose { gap:5px; padding-inline:6px; }
 .chat-text-label textarea { font-size:16px; }
}
@media(max-width:760px){
 .iphone-web-app[data-iphone-theme="aurora"] .chat-layout { background:#302a50; color:#faf5ff; border-color:#655482; }
 .iphone-web-app[data-iphone-theme="aurora"] :is(.chat-sidebar,.chat-compose,.chat-thread-head) { border-color:#655482; }
 .iphone-web-app[data-iphone-theme="aurora"] .chat-history { background:#221d39; }
 .iphone-web-app[data-iphone-theme="aurora"] .chat-bubble { background:#352c4d; }
 .iphone-web-app[data-iphone-theme="aurora"] :is(.chat-bubble.own,.chat-item:hover,.chat-item[aria-current],.chat-tabs [aria-current]) { background:#4a3a6a; color:#faf5ff; }
 .iphone-web-app[data-iphone-theme="aurora"] :is(.chat-bubble small,.chat-item small,.chat-contact-group h3,.chat-placeholder,.chat-thread-head small) { color:#ddd2f0; }
 .iphone-web-app[data-iphone-theme="aurora"] .chat-bubble strong { color:#e2c7ff; }
 .iphone-web-app[data-iphone-theme="aurora"] .chat-sticker-panel { background:#302a50; border-color:#655482; }
 .iphone-web-app[data-iphone-theme="aurora"] .chat-sticker-menu summary { color:#e2c7ff; }
 .iphone-web-app[data-iphone-theme="aurora"] :is(.chat-sticker-menu[open] summary,.chat-sticker-choice:hover,.chat-bubble.with-sticker small) { background:#4a3a6a; }
 .iphone-web-app[data-iphone-theme="aurora"] .chat-layout .chat-bubble.with-sticker { background:transparent; }
}
