:root {
  color-scheme: dark;
  --bg: #111418;
  --panel: #1a1f25;
  --line: #2b323a;
  --text: #e8ecf0;
  --muted: #8b95a1;
  --accent: #3d8bfd;
  --mine: #1f4e8c;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, sans-serif;
}

button,
input,
.attach {
  font: inherit;
  color: inherit;
}

button,
.attach {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

#pair {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
}

#pair h1 {
  margin: 0;
}

#qr-image {
  width: 280px;
  height: 280px;
  max-width: 100%;
  background: #fff;
  border-radius: 12px;
}

.hint {
  color: var(--muted);
  max-width: 420px;
}

#app {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
}

aside {
  border-right: 1px solid var(--line);
  background: var(--panel);
  overflow-y: auto;
}

aside header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.contact {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 0;
  text-align: left;
  padding: 12px;
}

.contact.active {
  background: var(--line);
}

.dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
}

.dot.on {
  background: #3ecf6e;
}

section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100vh;
}

#messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.bubble {
  align-self: flex-start;
  max-width: min(70%, 560px);
  background: var(--panel);
  border-radius: 12px;
  padding: 8px 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.bubble.mine {
  align-self: flex-end;
  background: var(--mine);
}

.bubble img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  border-radius: 8px;
}

.foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: #b4bcc6;
  font-size: 12px;
}

.remove {
  padding: 0 6px;
  font-size: 12px;
  background: transparent;
}

#composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

#text {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
}

#composer button[type='submit'] {
  background: var(--accent);
  border-color: var(--accent);
}
