* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
}

body {
  background-image: url("https://cdn.neowin.com/news/images/uploaded/2023/06/1686292349_windows_xp_bliss_wallpaper_4k.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-family: Tahoma, 'Segoe UI', sans-serif;
  color: #111;
  overflow: hidden;
}

.desktop {
  height: 100vh;
  padding: 16px;
}

.claim-screen,
.app-screen {
  height: calc(100vh - 32px);
}

.claim-screen[hidden],
.app-screen[hidden] {
  display: none !important;
}

.claim-screen {
  display: grid;
  place-items: center;
}

.claim-window {
  width: min(480px, 92vw);
}

.form-actions {
  margin-top: 8px;
}

.form-actions.between {
  justify-content: space-between;
}

.form-error {
  min-height: 1.2rem;
  color: #a20000;
  margin: 8px 0 0;
}

.app-window {
  width: min(1280px, 100%);
  margin: 0 auto;
  height: 100%;
  overflow: hidden;
}

.app-body {
  padding: 10px;
  height: calc(100% - 28px);
  display: flex;
  flex-direction: column;
}

.top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.username-line {
  margin: 0;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.panel {
  width: 100%;
}

.sidebar,
.chat-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-body,
.chat-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-body {
  gap: 8px;
}

.channel-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.channel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 4px 6px;
  text-align: left;
}

.channel-item.active {
  outline: 1px dotted #000;
  outline-offset: -3px;
  background: linear-gradient(180deg, #fff4bf 0%, #ffe27a 100%);
}

.channel-name {
  font-weight: 700;
}

.channel-count {
  min-width: 28px;
  text-align: center;
  border: 1px solid #7f9db9;
  background: #fff;
  padding: 0 4px;
}

.online-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: auto;
}

.online-pill {
  font-size: 11px;
  color: #134f0f;
  background: #d7ffd9;
  border: 1px solid #7f9db9;
  padding: 1px 6px;
  border-radius: 2px;
}

.channel-description {
  margin: 0 0 8px;
  color: #555;
}

.message-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid #7f9db9;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.message-row {
  border: 1px solid #d0d0d0;
  padding: 6px;
  background: #f8f8f8;
}

.message-row.self {
  background: #e8f3ff;
  border-color: #7f9db9;
}

.message-row header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.message-author {
  font-weight: 700;
}

.message-time {
  color: #666;
  font-size: 11px;
}

.message-row p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.new-message-nudge {
  align-self: center;
  margin-top: 8px;
}

.typing-indicator {
  min-height: 18px;
  margin: 8px 0 0;
  color: #666;
}

.message-form {
  margin-top: 8px;
}

.message-count {
  margin: 0;
  color: #666;
  font-size: 11px;
}

.message-count.danger {
  color: #b00000;
  font-weight: 700;
}

#message-input {
  width: 100%;
  resize: vertical;
}

.connection-status {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #ffffe1;
  border: 1px solid #7f9db9;
  padding: 4px 10px;
  box-shadow: 1px 1px 0 #fff inset, -1px -1px 0 #404040 inset;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .desktop {
    height: auto;
    min-height: 100vh;
  }

  .claim-screen,
  .app-screen {
    height: auto;
    min-height: calc(100vh - 32px);
  }

  .app-window {
    height: auto;
  }

  .app-body {
    height: auto;
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
    flex: initial;
  }

  .sidebar {
    max-height: 44vh;
  }

  .chat-pane {
    min-height: 56vh;
  }

  .top-strip {
    flex-wrap: wrap;
  }
}
