
body {
  margin: 0;
  background: #f4f6fa;
  font-family: Arial, sans-serif;
  color: #202b3a;
}

header {
  background: #001489;
  color: white;
  padding: 24px;
  text-align: center;
}

main {
  max-width: 760px;
  margin: 35px auto;
  padding: 20px;
}

.panel {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 3px 14px #00000012;
}

textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 110px;
  padding: 14px;
  font: inherit;
  border: 1px solid #bac3d3;
  border-radius: 8px;
}

button {
  background: #001489;
  color: white;
  border: 0;
  padding: 13px 24px;
  border-radius: 7px;
  cursor: pointer;
  margin-top: 12px;
}

button:disabled {
  opacity: 0.6;
}

#answer {
  margin-top: 20px;
  white-space: pre-wrap;
  line-height: 1.6;
}

#sources {
  margin-top: 15px;
  font-size: 14px;
}

footer {
  text-align: center;
  padding: 24px;
  color: #626b78;
  font-size: 13px;
}



/* MAX — Modern Maximum One Branding */

header {
  background: #001489;
  color: white;
  padding: 22px 28px;
  text-align: left;
}

.brand-header {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.max-avatar {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: white;
  color: #001489;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 27px;
  letter-spacing: 0.5px;
}

.brand-text p {
  margin: 5px 0 0;
  font-size: 14px;
  color: #dce5ff;
}


/* MAX — Modern Chat Panel */

body {
  background: #f5f7fc;
  font-family: Arial, sans-serif;
}

main {
  max-width: 850px;
  margin: 45px auto;
  padding: 20px;
}

.panel {
  background: #ffffff;
  border-radius: 20px;
  padding: 35px;
  box-shadow: 0 8px 30px rgba(0, 20, 100, 0.07);
}

.panel h2 {
  font-size: 25px;
  margin-top: 0;
  margin-bottom: 14px;
  color: #17233c;
}

.panel p {
  color: #526078;
  line-height: 1.6;
}

textarea {
  border: 1px solid #ccd5e6;
  border-radius: 12px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.5;
  background: #fbfcff;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: #001489;
  box-shadow: 0 0 0 3px rgba(0, 20, 137, 0.1);
}

button {
  background: #001489;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 13px 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #1537b5;
}

@media (max-width: 600px) {
  main {
    margin: 20px auto;
    padding: 12px;
  }

  .panel {
    padding: 22px;
  }
}

/* MAX — Suggested Question Cards */

.suggested-questions {
  margin: 28px 0;
}

.suggested-questions h3 {
  font-size: 16px;
  color: #17233c;
  margin-bottom: 14px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.question-grid .suggestion {
  background: #ffffff;
  color: #334155;
  border: 1px solid #dce3f0;
  border-radius: 12px;
  padding: 17px;
  text-align: left;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.question-grid .suggestion span {
  display: block;
  color: #001489;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}

.question-grid .suggestion:hover {
  background: #f0f4ff;
  border-color: #001489;
}

.question-grid .suggestion:focus-visible {
  outline: 3px solid #6688ff;
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .question-grid {
    grid-template-columns: 1fr;
  }
}



/* MAX — Professional Answer Display */

#answer:not(:empty) {
  background: #f7f9ff;
  border: 1px solid #dce5f5;
  border-left: 4px solid #001489;
  border-radius: 12px;
  padding: 24px;
  margin-top: 28px;
  line-height: 1.7;
  color: #243247;
}

#answer p {
  margin: 0 0 16px;
}

#answer p:last-child {
  margin-bottom: 0;
}

#answer ol,
#answer ul {
  padding-left: 26px;
  margin: 14px 0;
}

#answer li {
  margin-bottom: 12px;
  padding-left: 4px;
}

#answer strong {
  color: #001489;
}

#answer h2,
#answer h3,
#answer h4 {
  color: #001489;
  margin-top: 20px;
}

#sources:not(:empty) {
  margin-top: 16px;
  padding: 14px 18px;
  background: #eef2fb;
  border-radius: 10px;
  color: #526078;
  font-size: 13px;
  line-height: 1.6;
}



/* MAX — Answer Heading */

#answer-heading[hidden] {
  display: none;
}

#answer-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 10px;
  color: #001489;
  font-size: 17px;
}

.answer-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #001489;
  color: white;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

#answer-heading strong {
  font-weight: 700;
}

#answer-container #answer:not(:empty) {
  margin-top: 0;
}



/* MAX Dog Logo */

.max-dog-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px auto 24px;
}

.max-dog-logo img {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  object-fit: contain;
}

@media (max-width: 600px) {
  .max-dog-logo img {
    max-width: 200px;
  }
}



/* Max the Dog — Header Avatar */

.avatar {
  overflow: hidden;
  padding: 0;
  background: white;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}



/* Keep Max's header image small */

header .avatar {
  width: 54px !important;
  height: 54px !important;
  min-width: 54px;
  flex: 0 0 54px;
  overflow: hidden;
  border-radius: 12px;
  background: white;
  padding: 0;
}

header .avatar img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  object-fit: contain;
}


/* ==========================================
   MAX — Chat Conversation Interface
   ========================================== */

.chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.chat-toolbar h3 {
  margin: 0;
  color: #001489;
  font-size: 18px;
}

#newConversation {
  background: #fff;
  color: #001489;
  border: 1px solid #001489;
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#newConversation:hover {
  background: #eef2ff;
}

.chat-history {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin: 0 auto;
}

.chat-history:empty {
  display: none;
}

.chat-message {
  box-sizing: border-box;
  max-width: 85%;
  padding: 14px 18px;
  border-radius: 15px;
  overflow-wrap: anywhere;
  line-height: 1.6;
  font-size: 15px;
}

.chat-message.user {
  align-self: flex-end;
  background: #001489;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant {
  align-self: flex-start;
  background: #f1f4f9;
  color: #263247;
  border: 1px solid #e0e5ee;
  border-bottom-left-radius: 4px;
}

.chat-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  opacity: 0.8;
}

.chat-content p {
  margin: 0 0 10px;
}

.chat-content p:last-child {
  margin-bottom: 0;
}

.chat-content ul,
.chat-content ol {
  padding-left: 22px;
  margin: 8px 0 12px;
}

.chat-content li {
  margin-bottom: 6px;
}

.chat-content h3,
.chat-content h4,
.chat-content h5 {
  margin: 12px 0 7px;
  color: #001489;
}

.chat-sources {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #d6deea;
  color: #58677b;
  font-size: 12px;
  line-height: 1.5;
}

/* Keep the conversation comfortable on phones */

@media (max-width: 600px) {
  .chat-message {
    max-width: 94%;
    padding: 12px 14px;
    font-size: 14px;
  }

  .chat-toolbar h3 {
    font-size: 16px;
  }

  #newConversation {
    font-size: 12px;
    padding: 8px 12px;
  }
}

