.conversation-toolbar[hidden],
#conversationListPanel[hidden] {
  display: none !important;
}

.conversation-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: min(100% - 32px, 900px);
  margin: 14px auto;
}

.conversation-toolbar button {
  background: #102b49;
  border: 1px solid #3577ae;
  border-radius: 12px;
  color: #f0f8ff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.conversation-toolbar button:hover,
.conversation-toolbar button:focus-visible {
  background: #19466f;
  border-color: #69b9ff;
}

#conversationListPanel {
  width: min(100% - 32px, 900px);
  max-height: 330px;
  overflow-y: auto;
  margin: 12px auto;
  padding: 18px;
  background: #0c2138;
  border: 1px solid #284c70;
  border-radius: 16px;
  color: #f0f8ff;
}

#conversationListPanel h2 {
  font-size: 1.1rem;
  margin: 0 0 14px;
}

#conversationList {
  display: grid;
  gap: 8px;
}

#conversationList button {
  width: 100%;
  text-align: start;
  padding: 12px;
  color: #f0f8ff;
  background: #143352;
  border: 1px solid #305779;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  overflow-wrap: anywhere;
}

#conversationList button:hover,
#conversationList button:focus-visible {
  background: #205078;
}

#conversationListMessage {
  margin: 10px 0 0;
}

@media (max-width: 600px) {
  .conversation-toolbar {
    gap: 8px;
  }

  .conversation-toolbar button {
    flex: 1 1 100%;
    padding: 11px 14px;
  }

  #conversationListPanel {
    padding: 12px;
  }
}

/* 2R AI mobile conversations improvements */

.conversation-toolbar,
#conversationListPanel {
    box-sizing: border-box;
}

.conversation-toolbar button {
    min-height: 44px;
    touch-action: manipulation;
}

#conversationList button {
    min-height: 46px;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
}

#conversationListPanel[dir="rtl"],
#conversationListPanel[dir="rtl"] button {
    text-align: right;
}

#conversationListPanel[dir="ltr"],
#conversationListPanel[dir="ltr"] button {
    text-align: left;
}

@media (max-width: 600px) {
    .conversation-toolbar {
        width: calc(100% - 24px);
        margin: 12px auto;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .conversation-toolbar button {
        width: 100%;
        min-width: 0;
        padding: 11px 8px;
        font-size: 0.88rem;
        line-height: 1.4;
    }

    #conversationListPanel {
        width: calc(100% - 24px);
        max-height: min(45vh, 360px);
        padding: 12px;
        margin: 10px auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #conversationList button {
        font-size: 0.92rem;
        padding: 12px;
    }
}

@media (max-width: 360px) {
    .conversation-toolbar {
        grid-template-columns: 1fr;
    }
}