:root {
  color-scheme: light;
  --window: #edeceb;
  --border: #6e6d69;
  --line: #b4b2ab;
  --text: #1c1c1c;
  --muted: #6f6f6f;
  --me: #3f7a0a;
  --them: #2d5f9e;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
}
.desktop {
  position: fixed;
  inset: 0;
  font:
    12px/1.35 "DejaVu Sans",
    "Bitstream Vera Sans",
    Verdana,
    Tahoma,
    sans-serif;
  color: var(--text);
}

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: var(--window);
  border: 1px solid var(--border);
  border-radius: 5px 5px 0 0;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.6);
}
.buddy {
  left: 9vw;
  top: 11vh;
  width: min(250px, 80vw);
  max-height: min(600px, 86vh);
}
.chat {
  width: min(380px, 92vw);
  height: min(320px, 70vh);
}
.titlebar {
  display: flex;
  align-items: center;
  height: 22px;
  padding: 0 4px 0 8px;
  border-bottom: 1px solid var(--line);
  border-radius: 4px 4px 0 0;
  background: linear-gradient(#e6e5e1, #cfcdc7);
  color: #555;
  cursor: default;
  touch-action: none;
  user-select: none;
}
.window.active .titlebar {
  background: linear-gradient(#dfe3ea, #b7bdc8);
  color: #111;
  font-weight: bold;
}
.titlebar .title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}
.controls {
  display: flex;
  gap: 2px;
}
.controls > * {
  display: grid;
  place-items: center;
  width: 17px;
  height: 16px;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid #8d8b85;
  border-radius: 3px;
  background: linear-gradient(#fbfbfa, #dcdad5);
  color: #333;
  font:
    bold 10px/1 "DejaVu Sans",
    Verdana,
    sans-serif;
}
.controls .close {
  cursor: default;
}
.controls .close:hover {
  background: linear-gradient(#fff, #e9e7e2);
}
.controls .close:focus-visible {
  outline: 2px solid #3465a4;
  outline-offset: 1px;
}
.menubar {
  display: flex;
  gap: 12px;
  padding: 3px 8px;
  border-bottom: 1px solid var(--line);
  user-select: none;
}

.self {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px;
  padding: 3px 6px;
  border: 1px solid #a5a39c;
  border-radius: 3px;
  background: linear-gradient(#fdfdfc, #e4e2dd);
  user-select: none;
}
.self .arrow {
  margin-left: auto;
  color: #555;
}
.contacts {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 4px 4px;
  border: 1px solid #a5a39c;
  background: #fff;
}
.contacts h2 {
  margin: 0;
  padding: 3px 4px;
  font-size: 12px;
  user-select: none;
}
.contacts h2::before {
  content: "▾ ";
  color: #333;
}
.contacts ul {
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}
.contact {
  display: grid;
  grid-template-columns: 14px 1fr;
  column-gap: 6px;
  align-items: center;
  width: 100%;
  padding: 2px 6px 2px 18px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.contact:hover,
button.contact:focus-visible {
  background: #d6e0ee;
  outline: none;
}
button.contact.open {
  background: #86a5cf;
  color: #fff;
}
button.contact.open .msg {
  color: #eef3fa;
}
.contact .name,
.contact .msg {
  grid-column: 2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.contact .status {
  grid-row: 1 / span 2;
}
.contact .msg {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}
.contact.redacted {
  color: #222;
  user-select: none;
}
.contact.redacted .msg {
  color: #555;
  font-style: normal;
}

.status {
  display: inline-block;
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b8f08a, #3c9a10 70%);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.25);
}
.status.away {
  border-radius: 0;
  background: #cc2d1e;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  box-shadow: none;
}
.status.offline {
  background: #d4d4d4;
  box-shadow: inset 0 0 0 1px #8e8e8e;
}
.status.group {
  border-radius: 3px;
  background: radial-gradient(circle at 35% 30%, #b9d0f0, #3465a4 70%);
}

.tabbar {
  display: flex;
  padding: 4px 4px 0;
  user-select: none;
}
.tab {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 10px;
  border: 1px solid #a5a39c;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: #fff;
  overflow: hidden;
  white-space: nowrap;
}
.log {
  flex: 1;
  overflow-y: auto;
  margin: 0 4px;
  padding: 6px 8px;
  border: 1px solid #a5a39c;
  background: #fff;
  overflow-wrap: anywhere;
}
.log:focus-visible {
  outline: 2px solid #3465a4;
  outline-offset: -2px;
}
.log p {
  margin: 0 0 2px;
}
.log .stamp {
  margin: 8px 0 4px;
  color: #999;
  text-align: center;
}
.log .stamp:first-child {
  margin-top: 0;
}
.log .me {
  color: var(--me);
}
.log .them {
  color: var(--them);
}
.log .c3 {
  color: #a0359c;
}
.log .c4 {
  color: #b35a00;
}
.log .c5 {
  color: #b3261e;
}
.log .scam-link {
  color: #0000ee;
  text-decoration: underline;
}
.input {
  height: 44px;
  margin: 4px;
  border: 1px solid #a5a39c;
  background: #fff;
}
