/* The secret chat-log page: an old desktop messenger window (blue glass title bar, white panes). */
.chat-index { padding-left: 1.2em; }
.chat-index li { margin: 4px 0; }

.im {
  max-width: 760px; margin: 8px auto 20px;
  border: 1px solid #d98ab3; border-radius: 8px 8px 4px 4px; overflow: hidden;
  background: #fdf0f6; color: #4a2a3c;
  font: 13px/1.5 "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  box-shadow: 0 10px 30px rgba(150, 50, 100, .25);
}
.im-titlebar {
  display: flex; align-items: center; padding: 5px 8px;
  background: linear-gradient(#fdeef5, #f6c6dc); color: #5a2a44; font-weight: 600; text-align: center;
}
.im-title { flex: 1; }
.im-buttons { display: flex; gap: 3px; }
.im-buttons i { display: grid; place-items: center; width: 20px; height: 17px; border: 1px solid #df9cc0; border-radius: 3px; background: #fff7fb; font-style: normal; font-size: 11px; }
.im-menu { display: flex; gap: 14px; padding: 2px 10px; background: #fff5f9; border-bottom: 1px solid #f3d2e2; font-size: 12px; }
.im-tools { display: flex; gap: 18px; padding: 6px 14px; background: linear-gradient(#fffafc, #fbe2ee); border-bottom: 1px solid #efc6da; }
.im-tools span { display: flex; flex-direction: column; align-items: center; font-size: 11.5px; color: #b23a74; }
.im-tools b { font-size: 22px; line-height: 1.2; }

.im-body { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 8px; padding: 8px; }
.im-left { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.im-chat { display: flex; flex-direction: column; border: 1px solid #e7a7c8; border-radius: 6px; background: #fff; overflow: hidden; }
.im-to { padding: 6px 10px; border-bottom: 1px solid #f8e1ec; color: #5a2a44; overflow-wrap: anywhere; }
.im-info { margin: 0 6px; padding: 2px 8px; border: 1px solid #e3a3c4; background: #fff0f7; font-size: 12px; }
.im-log { min-height: 260px; max-height: 560px; overflow-y: auto; padding: 8px 12px 14px; }
.im-msg { margin-bottom: 8px; }
.im-says { margin: 0; color: #94677f; }
.im-time { font-size: 11px; color: #b893a6; }
.im-text { margin: 0 0 0 14px; color: #111; overflow-wrap: anywhere; }
.im-mine .im-text { color: #c23272; }

.im-compose { border: 1px solid #e7a7c8; border-radius: 6px; background: #fff; overflow: hidden; }
.im-compose-tools { padding: 3px 8px; border-bottom: 1px solid #f8e1ec; background: linear-gradient(#fffafc, #fde9f2); font-size: 12px; color: #b23a74; }
.im-compose-tools span { margin-left: 10px; text-decoration: underline; }
.im-compose-row { display: flex; }
.im-input { flex: 1; height: 62px; }
.im-send { display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 56px; margin: 4px; border: 1px solid #e3a9c6; border-radius: 4px; background: #fff6fa; text-align: center; font-size: 12px; }
.im-send b { text-decoration: underline; }
.im-status { margin: 0; padding: 3px 8px; border-top: 1px solid #f3d2e2; font-size: 11.5px; color: #8a5a72; }

.im-right { display: flex; flex-direction: column; gap: 8px; }
.im-spacer { flex: 1; }
.im-pic { margin: 0; padding: 5px; border: 1px solid #e7a7c8; border-radius: 8px; background: #fff; text-align: center; }
.im-pic img, .im-pic span { display: block; width: 100%; aspect-ratio: 1; border: 1px solid #efc3d8; border-radius: 4px; object-fit: cover; }
.im-pic span { display: grid; place-items: center; background: #fbe0ec; font-size: 40px; color: #d98ab3; }
.im-pic figcaption { margin-top: 3px; font-size: 11px; color: #8a5a72; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .im-body { grid-template-columns: 1fr; }
  .im-right { flex-direction: row; flex-wrap: wrap; }
  .im-pic { width: 96px; }
  .im-spacer { display: none; }
  .im-tools { gap: 10px; overflow-x: auto; }
}

/* ---------- the contact list ---------- */
.im-list { max-width: 420px; }
.im-me { display: flex; gap: 12px; align-items: center; margin: 8px; padding: 10px; border: 1px solid #ecb7d1; border-radius: 8px; background: linear-gradient(#fffafc, #fbe1ed); }
.im-me-pic img, .im-me-pic span { display: grid; place-items: center; width: 72px; height: 72px; border: 2px solid #fff; border-radius: 8px; box-shadow: 0 0 0 1px #e7a7c8; object-fit: cover; background: #fbe0ec; color: #d98ab3; font-size: 30px; }
.im-me-text p { margin: 0; }
.im-me-name { font-size: 16px; font-weight: 700; }
.im-me-name span, .im-me-status, .im-away { color: #a97f95; font-weight: 400; font-size: 12px; }
.im-me-links { margin-top: 4px !important; font-size: 12px; }
.im-me-links a { margin-left: 8px; color: #b23a74; }
.im-contacts { display: flex; min-height: 380px; margin: 0 8px; border: 1px solid #ecb7d1; border-radius: 8px; background: #fff; overflow: hidden; }
.im-tabs { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px; background: linear-gradient(90deg, #fbe0ec, #fff3f8); border-right: 1px solid #efc6da; }
.im-tabs i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #fff; font-style: normal; font-size: 18px; box-shadow: 0 1px 2px rgba(150, 50, 100, .2); }
.im-groups { flex: 1; min-width: 0; padding: 8px 10px; }
.im-group summary { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; list-style: none; color: #4a2a3c; }
.im-group summary::-webkit-details-marker { display: none; }
.im-group summary::before { content: '+'; display: grid; place-items: center; width: 13px; height: 13px; border: 1px solid #c98aac; font-size: 11px; line-height: 1; color: #7a3a5c; }
.im-group[open] summary::before { content: '−'; }
.im-friend-pic img, .im-friend-pic { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; object-fit: cover; background: #fbe0ec; color: #d98ab3; font-size: 12px; overflow: hidden; }
.im-count { color: #7a3a5c; }
.im-group ul { margin: 2px 0 8px; padding: 0 0 0 40px; list-style: none; }
.im-group li { margin: 3px 0; overflow-wrap: anywhere; }
.im-group li a { color: #4a2a3c; text-decoration: none; }
.im-group li a:hover { color: #b23a74; text-decoration: underline; }
.im-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffc2dc, #e0559a); vertical-align: middle; }
.im-add { margin: 8px; padding: 6px 10px; border: 1px solid #efc6da; border-radius: 6px; background: linear-gradient(#fffafc, #fde9f2); }
.im-add a { color: #c2407f; text-decoration: none; font-weight: 600; }

/* ---------- the lock ---------- */
.im-lock { max-width: 360px; }
.im-lock-body { display: flex; flex-direction: column; gap: 8px; margin: 10px; padding: 16px; border: 1px solid #ecb7d1; border-radius: 8px; background: #fff; }
.im-lock-when { margin: 0; font-weight: 700; color: #4a2a3c; }
.im-lock-body label { font-size: 12px; color: #8a5a72; }
.im-lock-body input { padding: 6px 8px; border: 1px solid #e3a9c6; border-radius: 4px; font: inherit; }
.im-lock-body input:focus { outline: none; border-color: #c2407f; box-shadow: 0 0 0 2px #fbe0ec; }
.im-lock-actions { display: flex; justify-content: flex-end; }
.im-lock-actions button { padding: 4px 18px; border: 1px solid #df9cc0; border-radius: 4px; background: linear-gradient(#fffafc, #fbe2ee); color: #b23a74; font: inherit; font-weight: 600; cursor: pointer; }
.im-lock-error { margin: 0; color: #c23272; font-size: 12px; }
.im-lock-note { margin: 0; color: #a97f95; font-size: 11.5px; }

/* ---------- (asides in brackets) ---------- */
.im-aside { color: #b893a6; font-style: italic; }

/* ---------- the popup ---------- */
html.im-popup-open { overflow: hidden; }
.im-popup { position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: 16px; background: rgba(90, 40, 70, .4); backdrop-filter: blur(3px); }
.im-popup[hidden] { display: none; }
.im-popup-box { position: relative; width: min(980px, 100%); height: min(860px, 100%); }
.im-popup-frame { width: 100%; height: 100%; border: 0; border-radius: 10px; background: transparent; }
.im-popup-close { position: absolute; top: -12px; right: -12px; z-index: 1; width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50%; background: #e0559a; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(120, 30, 70, .35); }
/* inside the popup the window fills the frame */
.im-popup-page { margin: 0; padding: 0; background: transparent; }
.im-popup-page .im { max-width: none; height: 100vh; margin: 0; display: flex; flex-direction: column; border-radius: 10px; }
.im-popup-page .im-body { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr) 180px; }
.im-popup-page .im-left { min-height: 0; }
.im-popup-page .im-chat { flex: 1; min-height: 0; }
.im-popup-page .im-log { flex: 1; max-height: none; font-size: 14px; }
.im-popup-page .im-lock { height: auto; max-width: 360px; margin: 40px auto; }
@media (max-width: 640px) {
  .im-popup { padding: 8px; }
  .im-popup-close { top: 4px; right: 4px; }
  .im-popup-page .im-body { grid-template-columns: 1fr; }
  .im-popup-page .im-right { display: none; }
}

/* the title bar's × is a real button (closes the popup, or goes back to the list) */
.im-buttons .im-x { display: grid; place-items: center; width: 20px; height: 17px; border: 1px solid #df9cc0; border-radius: 3px; background: #fff7fb; color: inherit; font-size: 11px; text-decoration: none; cursor: pointer; }
.im-buttons .im-x:hover { background: #e0559a; border-color: #c2407f; color: #fff; }

/* ---------- several "me": pick the account ---------- */
.im-accounts { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 8px 0; }
.im-accounts a { display: flex; align-items: center; gap: 5px; padding: 3px 10px 3px 4px; border: 1px solid #ecb7d1; border-radius: 99px; background: #fff7fb; color: #7a3a5c; text-decoration: none; font-size: 12px; }
.im-accounts a:hover { background: #fde9f2; }
.im-accounts a.im-account-on { border-color: #e0559a; background: #e0559a; color: #fff; font-weight: 700; }
.im-account-pic, .im-account-pic img { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; object-fit: cover; background: #fbe0ec; color: #c2407f; font-size: 11px; overflow: hidden; }
