body[data-mode="chat"] #chat #rooms .profile-nav-button .profile-nav-icon {width:16px;height:16px;flex:none;fill:none;stroke:#f3bbd9;stroke-width:1.7;stroke-linecap:round}
body[data-mode="chat"] #chat #rooms .profile-nav-button {flex-shrink:0}
#guest-profile {
 width:min(430px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:auto;
 padding:0;border:1px solid #ba84a2;border-radius:14px;background:#fff5fa;color:#432637;
 box-shadow:0 20px 70px #170b19a6;
}
#guest-profile::backdrop {background:#180f1bd0}
#guest-profile form {display:grid;gap:10px;padding:20px}
#guest-profile header {display:flex;align-items:start;justify-content:space-between;gap:12px}
#guest-profile header p,#guest-profile .guest-profile-note {color:#6b4d60;margin:0;font-size:13px}
#guest-profile-close {
 width:36px;height:36px;border:1px solid #d7b6c9;border-radius:8px;
 background:#f1deea;color:#502c42;font-size:23px;line-height:1;
}
#guest-profile .guest-profile-photo {display:flex;align-items:center;gap:12px;min-width:0;margin:4px 0}
#guest-profile .guest-profile-photo>div {min-width:0;flex:1}
#guest-profile .guest-profile-photo img {flex:none;object-fit:cover;border-radius:12px;background:#ead3e2}
#guest-profile label {margin:0;color:#533247;font-weight:650}
#guest-profile label small {color:#74576b}
#guest-profile input {
 min-width:0;margin:0;padding:8px;border:1px solid #cda9be;border-radius:8px;
 background:#fff;color:#452639;font-size:16px;
}
#guest-profile input[type=file] {font-size:12px;padding:5px;margin:4px 0}
#guest-profile .text-btn {color:#7d2d57}
#guest-profile-status {color:#7d2d57;margin:0;font-size:13px}
#guest-profile-status:empty {display:none}
#guest-profile .primary {background:#83365e;color:#fff}

/* While typing, keep the navigation in one row and give the thread more room. */
@media(max-width:780px){
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat>.sidebar {
  grid-template-columns:minmax(0,1fr) auto auto;grid-template-rows:38px;gap:5px;padding:5px 7px;
 }
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat .inbox-section {grid-column:2;grid-row:1}
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat .sidebar-bottom {grid-column:3;grid-row:1}
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat #inbox-toggle {
  position:relative;width:auto;min-width:48px;height:38px;min-height:38px;padding:4px 6px;gap:4px;
 }
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat #inbox-toggle>span:nth-child(2) {
  position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
 }
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat .chat-main {
  grid-template-rows:48px minmax(0,1fr) 86px 18px;
 }
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat .chat-heading {padding-block:3px}
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat .composer {padding-block:3px}
}
#guest-profile form {padding:clamp(16px,5vw,24px);gap:14px}
#guest-profile .guest-profile-kicker {font-size:10px;font-weight:750;letter-spacing:.14em;color:#8d456b}
#guest-profile h2 {margin:3px 0 0;font-size:26px}
#guest-profile .guest-profile-photo {
 gap:14px;margin:0;padding:12px;border:1px solid #e5c6d7;border-radius:12px;background:#fae8f1;
}
#guest-profile-nick {margin:0;color:#432637;font-weight:750;overflow-wrap:anywhere}
#guest-profile .guest-profile-caption {margin:1px 0 8px;color:#6b4d60;font-size:12px}
#guest-profile .guest-profile-pick {
 display:inline-flex;align-items:center;min-height:32px;padding:4px 8px;
 border:1px solid #d8adca;border-radius:7px;background:#fff7fa;cursor:pointer;
}
#guest-profile .guest-profile-photo:has(input:focus-visible) .guest-profile-pick {outline:2px solid #8d456b;outline-offset:2px}
#guest-profile-remove {margin-left:8px;font-size:12px}
#guest-profile-enlarge {
 position:relative;flex:0 0 72px;display:block;width:72px;height:72px;padding:0;border:0;
 border-radius:12px;background:#ead3e2;cursor:zoom-in;
}
#guest-profile-enlarge img {display:block;width:100%;height:100%}
#guest-profile-enlarge span {
 position:absolute;right:3px;bottom:3px;padding:1px 4px;border-radius:4px;background:#382034;color:#fff;
}
#guest-profile .guest-profile-location {display:grid;gap:5px}
#chat .avatar-zoom-button {
 display:inline-flex;align-items:center;justify-content:center;flex:none;padding:0;border:0;
 border-radius:8px;background:transparent;color:inherit;cursor:zoom-in;line-height:1;
}
#guest-avatar-view {
 width:min(440px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:auto;
 padding:16px;border:1px solid #ba84a2;border-radius:14px;background:#fff5fa;color:#432637;
}
#guest-avatar-view::backdrop {background:#180f1bd0}
#guest-avatar-view header {display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
#guest-avatar-title {font-size:17px;margin:0;overflow-wrap:anywhere}
#guest-avatar-view .profile-close {
 flex:none;width:36px;height:36px;padding:0;border:1px solid #d7b6c9;border-radius:8px;
 background:#f1deea;color:#502c42;font-size:23px;line-height:1;
}
#guest-avatar-image {display:block;width:min(100%,320px,calc(100dvh - 110px));height:auto;margin:auto;border-radius:10px}
#guest-avatar-error {color:#6b4d60}
@media(max-width:780px){
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat #rooms>.room-button:first-child {flex:0 1 auto;min-width:42px}
 html.chat-viewport-locked body[data-mode="chat"].chat-keyboard-open #chat #rooms>.room-button:first-child .room-name {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}

body[data-mode="chat"] #chat #people-panel #users .user-city {
 display:block;max-width:100%;margin:0 0 4px;color:#704b63;
 font-size:12px;font-weight:550;line-height:1.35;overflow-wrap:anywhere;
}

#guest-crop {display:grid;gap:9px;padding:12px;border:1px solid #e5c6d7;border-radius:12px;background:#fae8f1}
#guest-crop[hidden] {display:none}
#guest-crop h3 {margin:0;color:#432637}
#guest-crop p {margin:0;color:#6b4d60;font-size:12px}
#guest-crop-canvas {
 display:block;width:min(100%,250px);height:auto;aspect-ratio:1;margin:0 auto;
 border-radius:9px;background:#ead3e2;cursor:grab;touch-action:none;
}
#guest-crop-canvas:active {cursor:grabbing}
#guest-crop-canvas:focus-visible {outline:2px solid #8d456b;outline-offset:3px}
#guest-crop #guest-crop-zoom {padding:0;accent-color:#83365e}
#guest-crop .guest-crop-actions {display:flex;flex-wrap:wrap;gap:8px 12px;justify-content:flex-end}

/* Match the inner frame for both plain and clickable avatars in the online list. */
body[data-mode="chat"] #chat #people-panel #users .people-avatar > .avatar-zoom-button,
body[data-mode="chat"] #chat #people-panel #users .people-avatar > .avatar,
body[data-mode="chat"] #chat #people-panel #users .people-avatar > .avatar-zoom-button > .avatar {
 display:block;width:100%;height:100%;max-width:none;margin:0;border:0;border-radius:9px;
}
body[data-mode="chat"] #chat #people-panel #users .people-avatar img {
 display:block;width:100%;height:100%;object-fit:cover;
}

#guest-profile {
 width:min(464px,calc(100% - 24px));border-color:#c79bb7;border-radius:21px;
 background:#fff7fa;box-shadow:0 24px 75px #1e102387;
}
#guest-profile form {--profile-inset:clamp(15px,5vw,23px);padding:0 var(--profile-inset) var(--profile-inset);gap:15px}
#guest-profile form>header {
 margin-inline:calc(-1 * var(--profile-inset));padding:18px var(--profile-inset);
 background:linear-gradient(118deg,#372137,#653954);color:#fff6fa;
}
#guest-profile .guest-profile-kicker {color:#f6bfd9;letter-spacing:.13em}
#guest-profile h2 {color:#fff6fa;letter-spacing:-.03em;line-height:1.15}
#guest-profile-close {flex:none;border-color:#f4c5dc61;background:#ffffff14;color:#fff6fa}
#guest-profile .guest-profile-photo {
 padding:12px;gap:12px;border-color:#ead2df;border-radius:15px;
 background:linear-gradient(120deg,#f5e2ed,#fff9fb);
}
#guest-profile-enlarge {
 width:78px;height:78px;flex-basis:78px;border:2px solid #fff;
 box-shadow:0 4px 12px #54284235;
}
#guest-profile-nick {font-size:16px;line-height:1.3}
#guest-profile .guest-profile-caption {margin:2px 0 6px}
#guest-profile .guest-profile-pick {min-height:36px;padding:5px 10px;color:#542a45;font-size:12px}
#guest-profile-remove {min-height:32px;margin-left:6px;text-underline-offset:3px}
#guest-profile .guest-profile-location {gap:6px}
#guest-profile-city {min-height:42px}
#guest-profile .guest-profile-note {
 padding:8px 10px;border-left:2px solid #c68eaf;background:#f7eaf2;border-radius:0 7px 7px 0;
 font-size:12px;line-height:1.5;
}
#guest-profile form>button[type=submit] {
 width:100%;min-height:44px;border-radius:10px;
 background:linear-gradient(110deg,#723050,#96446e);font-size:14px;
}
#guest-profile :is(button,input,canvas):focus-visible {outline:2px solid #8d456b;outline-offset:2px}
#guest-profile #guest-profile-close:focus-visible {outline-color:#f6bfd9}
#guest-crop {background:#fffafd;border-color:#ead2df;border-radius:13px}
#guest-crop-canvas {box-shadow:0 0 0 1px #d9b4c9}

/* Square corners in the profile and its enlarged image view only. */
#guest-profile,
#guest-profile .guest-profile-photo,
#guest-profile .guest-profile-photo img,
#guest-profile #guest-profile-enlarge,
#guest-profile #guest-profile-enlarge span,
#guest-profile .guest-profile-pick,
#guest-profile .profile-close,
#guest-profile input:not([type=range]),
#guest-profile .guest-profile-note,
#guest-profile #guest-crop,
#guest-profile #guest-crop-canvas,
#guest-profile #guest-crop .primary,
#guest-profile form>button[type=submit],
#guest-avatar-view,
#guest-avatar-view .profile-close,
#guest-avatar-view #guest-avatar-image {border-radius:0}
