html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
}

.gov-bar {
  width: 100%;
  height: 50px;
  background: #0a43b5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  box-sizing: border-box;
  position: relative;
  z-index: 100;
}

.gov-logo {
  height: 24px;
}

.lang-toggle {
  height: 24px;
  cursor: pointer;
}

.viewport-container {
  height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
  position: relative;
}

.background,
.background-campus {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -1;
}

.background {
  background-image: url('background/degradedBackground.svg');
}

.background-campus {
  background-image: url('background/campus.svg');
  background-size: cover;
  background-position: center 0%;
  background-repeat: no-repeat;
  z-index: -2;
}

.main-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 0 20px 0;
  color: white;
  flex-shrink: 0;
}

.logo-escudo {
  position: fixed;
  top: 72px;
  left: 77px;
  width: 237px;
  height: 70px;
  z-index: 10;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  object-fit: contain;
}

.main-title {
  font-size: 44.5px;
  font-weight: 700;
  margin: 0;
  color: #fffae8;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  max-width: 100%;
}

.main-subtitle {
  font-size: 15px;
  font-weight: 400;
  margin: 0;
  color: #f4f4f4;
  max-width: 900px;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.content-layout {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 60px;
  padding: 20px 80px 30px;
  min-height: 0;
}

.pato-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  flex-shrink: 1;
  min-width: 0;
  margin-left: -10px;
  max-width: 350px;
}

.pato-img {
  width: 310px;
  height: 510px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

/* .mic-btn-pato {
  background: #f54900;
  color: white;
  border: none;
  width: 400px;
  height: 51px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.mic-btn-pato:hover {
  background: #e04401;
  transform: translateY(-1px);
} */

.chat-column {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 1040px;
  min-height: 0;
  height: auto;
}

.chat-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  height: 410px;
  width: 100%;
  max-width: none;
  overflow: visible;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  box-sizing: border-box;
  position: relative;
}

.chat-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 20px;
  position: relative;
}

.chat-header-container {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.chat-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  flex-shrink: 0;
}

.chat-icon {
  width: 35px;
  height: 35px;
}

.chat-header-text {
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: center;
  justify-content: center;
  align-items: center;
}

.chat-header h2 {
  margin: 0;
  width: auto;
  height: auto;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: 0%;
  text-align: center;
  color: #000000;
}

.chat-header p {
  margin: 0;
  width: auto;
  height: auto;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0%;
  text-align: center;
  color: #666666;
}

.sugerencias {
  margin-top: 0;
}

.sugerencias > p {
  width: 840px;
  height: auto;
  min-height: 30px;
  margin: 0 auto 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0%;
  text-align: center;
  color: #202621;
}

.sugerencias > p strong {
  font-weight: 700;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  max-width: 600px;
  margin: 0 auto;
  row-gap: 16px;
}

.tag {
  border: 2px solid #00b3f0;
  border-radius: 50px;
  padding: 10px 20px;
  cursor: pointer;
  background: white;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 100%;
  letter-spacing: 0%;
  color: #464d47;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.tag:hover {
  background: #00aae2;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(11, 135, 91, 0.25);
}

.tag-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tag:hover .tag-icon-svg {
  filter: brightness(0) invert(1);
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  margin: 0 0 12px 0;
  min-height: 80px;
  max-height: 200px;
  will-change: scroll-position;
}

#messages.full-height {
  max-height: none;
}

.msg:first-child {
  margin-top: 0;
}

.msg {
  max-width: 86%;
  padding: 5px 15px;
  border-radius: 14px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 1px;
  position: relative;
}

.msg-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  position: absolute;
}

.msg.user {
  background: #f4f4f4;
  margin-left: auto;
  color: #000000;
  margin-right: 80px;
  border-top-right-radius: 0;
}

.msg.user .msg-icon {
  right: -68px;
  top: 0;
}

.msg.bot {
  background: #e5ecf8;
  color: #000000;
  margin-left: 80px;
  position: relative;
}

.msg.bot .msg-icon {
  left: -68px;
  bottom: 0;
  z-index: 1;
}

.msg.bot::before {
  content: '';
  position: absolute;
  left: -20px;
  bottom: 0;
  width: 30px;
  height: 50%;
  background: #e5ecf8;
  z-index: 0;
}

.msg.bot::after {
  content: '';
  position: absolute;
  left: -20px;
  bottom: 0;
  width: 20px;
  height: 50%;
  background: white;
  border-bottom-right-radius: 100%;
  z-index: 0;
}

.msg a {
  color: #0a43b5;
  text-decoration: underline;
  word-break: break-all;
}

.msg a:hover {
  color: #f54900;
}

#typing {
  display: none;
  color: #666;
  font-family: 'Poppins', sans-serif;
  padding: 6px 10px;
  font-size: 13px;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fbfbfb;
  border: 1px solid #7e7e7e;
  border-radius: 50px;
  height: 62px;
  padding: 0 8px 0 20px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-top: 12px;
  max-width: 1300px;
  width: 100%;
  box-sizing: border-box;
}

.chat-input-area input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 100%;
  letter-spacing: 0%;
  padding: 0px 12px;
  height: 100%;
  background: transparent;
  color: #000000;
}

.chat-input-area input::placeholder {
  color: #7e7e7e;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 100%;
  letter-spacing: 0%;
  opacity: 1;
}

.send-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.send-btn:hover {
  transform: scale(1.08);
}

.send-btn img {
  width: 40px;
  height: 40px;
}

.send-icon {
  display: inline-block;
}

.loader-icon {
  display: none;
}

.send-btn.loading .send-icon {
  display: none;
}

.send-btn.loading .loader-icon {
  display: inline-block;
}

#messages::-webkit-scrollbar {
  width: 6px;
}

#messages::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 6px;
  box-shadow: inset 0 0 5px #b9b9b9;
}

#messages::-webkit-scrollbar-thumb {
  background: #1e2959;
  border-radius: 6px;
  box-shadow: 0 2px 6px #b9b9b9;
}

@media (min-width: 901px) and (max-width: 1440px) {
  .logo-escudo {
    width: 200px;
    height: 74px;
    top: 65px;
    left: 50px;
  }

  .main-title {
    font-size: 36px;
  }

  .main-subtitle {
    font-size: 14px;
  }

  .main-header {
    padding: 5px 0 20px 0;
  }

  .content-layout {
    gap: 40px;
    padding: 5px 40px 25px;
  }

  .pato-column {
    max-width: 300px;
  }

  .pato-img {
    width: 300px;
    height: 570px;
  }

  /*   .mic-btn-pato {
    width: 320px;
    height: 62px;
    font-size: 17px;
  } */

  .chat-card {
    height: 490px;
    width: 100%;
    max-width: none;
    padding: 26px;
  }

  .chat-header {
    margin-bottom: 70px;
  }

  .chat-header h2 {
    font-size: 34px;
  }

  .chat-header p {
    font-size: 17px;
  }

  .chat-header-icon {
    width: 34px;
    height: 34px;
  }

  .new-conversation-btn {
    top: -14px;
    height: 30px;
    padding: 0 14px;
    font-size: 11px;
    gap: 6px;
    border-radius: 15px;
  }

  .new-conv-icon {
    width: 13px;
    height: 13px;
  }

  .sugerencias > p {
    width: 100%;
    max-width: 700px;
    font-size: 17px;
  }

  .tag {
    font-size: 11px;
    padding: 9px 18px;
  }

  .msg {
    font-size: 14px;
    padding: 18px 14px;
  }

  .msg-icon {
    width: 45px;
    height: 45px;
  }

  .msg.user {
    margin-right: 68px;
  }

  .msg.bot {
    margin-left: 68px;
  }

  .msg.user .msg-icon {
    right: -58px;
  }

  .msg.bot .msg-icon {
    left: -58px;
  }
}

@media (min-width: 1600px) {
  .content-layout {
    gap: 90px;
    padding: 10px 110px 50px;
  }

  .main-header {
    padding: 10px 0 25px 0;
  }

  .main-title {
    font-size: 52px;
  }

  .main-subtitle {
    font-size: 18px;
    max-width: 1200px;
  }

  .logo-escudo {
    width: 300px;
    height: 90px;
    top: 82px;
    left: 60px;
  }

  .pato-column {
    max-width: 450px;
  }

  .pato-img {
    width: 450px;
    height: 650px;
  }

  /*   .mic-btn-pato {
    width: 450px;
    height: 62px;
    font-size: 22px;
    gap: 15px;
  } */

  .chat-column {
    max-width: 1300px;
  }

  .chat-card {
    height: 570px;
    width: 1260px;
    padding: 34px;
    border-radius: 18px;
  }

  .chat-header {
    margin-bottom: 110px;
    gap: 16px;
  }

  .chat-header h2 {
    font-size: 50px;
  }

  .chat-header p {
    font-size: 25px;
  }

  .chat-icon {
    width: 60px;
    height: 60px;
  }

  .chat-header-icon {
    width: 60px;
    height: 60px;
  }

  .sugerencias {
    margin-top: 0;
  }

  .sugerencias > p {
    font-size: 25px;
    width: 1050px;
    height: 38px;
    margin-bottom: 32px;
  }

  .tags {
    max-width: 750px;
    gap: 10px 15px;
    row-gap: 20px;
  }

  .tag {
    font-size: 15px;
    padding: 12px 24px;
    border-radius: 60px;
    font-weight: 600;
  }

  .tag-icon-svg {
    width: 25px;
    height: 25px;
  }

  #messages {
    max-height: 250px;
  }

  .msg {
    font-size: 17px;
    padding: 5px 18px;
    margin: 24px 0;
    border-radius: 18px;
  }

  .msg-icon {
    width: 60px;
    height: 60px;
  }

  .msg.user {
    margin-right: 100px;
  }

  .msg.bot {
    margin-left: 100px;
  }

  .msg.user .msg-icon {
    right: -85px;
  }

  .msg.bot .msg-icon {
    left: -85px;
  }

  .msg.bot::before {
    left: -25px;
    width: 38px;
  }

  .msg.bot::after {
    left: -25px;
    width: 25px;
  }

  .chat-input-area {
    max-width: 1300px;
    height: 62px;
    padding: 5px 11px 5px 25px;
    border-radius: 60px;
    margin-top: 15px;
  }

  .chat-input-area input {
    font-size: 17px;
    padding: 18px 15px;
  }

  .chat-input-area input::placeholder {
    font-size: 17px;
  }

  .send-btn img {
    width: 50px;
    height: 50px;
  }

  #messages::-webkit-scrollbar {
    width: 8px;
  }

  #typing {
    font-size: 16px;
    padding: 8px 13px;
  }
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-column {
  position: relative;
}

.new-conversation-btn {
  display: none;
  position: absolute;
  top: -19px;
  right: 0;
  height: 38px;
  background: rgba(10, 67, 181, 0.75);
  backdrop-filter: blur(5px);
  border: none;
  border-radius: 20px;
  padding: 0 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
  gap: 8px;
  align-items: center;
}

.new-conversation-btn.visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.new-conv-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.new-conversation-btn:hover {
  background: rgba(10, 67, 181, 0.70);
  transform: scale(1.04);
}

.new-conversation-btn:active {
  background: rgba(180, 180, 180, 0.95);
}

@media (min-width: 2560px) {
  .content-layout {
    gap: 130px;
    padding: 50px 160px 65px;
  }

  .main-header {
    padding: 65px 0 33px 0;
  }

  .main-title {
    font-size: 69px;
  }

  .main-subtitle {
    font-size: 24px;
    max-width: 1600px;
  }

  .logo-escudo {
    width: 410px;
    height: 132px;
    top: 110px;
    left: 73px;
  }

  .pato-img {
    width: 410px;
    height: 676px;
  }

  /*   .mic-btn-pato {
    width: 546px;
    height: 90px;
    font-size: 32px;
    gap: 21px;
  } */

  .chat-column {
    max-width: 1840px;
  }

  .chat-card {
    max-width: 1840px;
    height: 765px;
    padding: 49px;
    border-radius: 42px;
  }

  .chat-header {
    margin-bottom: 159px;
  }

  .chat-header h2 {
    font-size: 70px;
  }

  .chat-header p {
    font-size: 35px;
  }

  .sugerencias > p {
    font-size: 35px;
  }
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .viewport-container {
    min-height: 100vh;
    height: auto;
  }

  .background,
  .background-campus {
    position: fixed;
  }

  .logo-escudo {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 130px;
    height: 47px;
  }

  .main-header {
    padding: 15px 15px 15px;
    margin-top: 50px;
    gap: 12px;
  }

  .main-title {
    font-size: 30px;
    padding: 0 15px;
    line-height: 1.1;
  }

  .main-subtitle {
    font-size: 13px;
    padding: 0 15px;
    max-width: 100%;
  }

  .content-layout {
    flex-direction: column;
    padding: 10px 15px 20px;
    gap: 20px;
    justify-content: flex-start;
    align-items: center;
  }

  .pato-column {
    display: none;
  }

  .chat-column {
    max-width: 100%;
    width: 100%;
  }

  .chat-card {
    padding: 20px;
    height: 500px;
    max-height: 10vh;
    min-height: 400px;
    max-width: 100%;
  }

  .chat-header {
    margin-bottom: 40px;
  }

  .chat-header h2 {
    font-size: 26px;
  }

  .chat-header p {
    font-size: 16px;
  }

  .chat-icon {
    width: 30px;
    height: 30px;
  }

  .chat-header-icon {
    width: 30px;
    height: 30px;
  }

  .chat-header-container {
    position: relative;
    justify-content: center;
    align-items: center;
  }

  .chat-header-icon {
    position: absolute;
    left: -8px;
    top: 0;
    width: 30px;
    height: 30px;
  }

  .chat-header h2 {
    max-width: 250px;
  }

  .sugerencias {
    margin-top: 20px;
  }

  .sugerencias > p {
    width: 100%;
    font-size: 14px;
    height: auto;
    padding: 0;
  }

  .tags {
    max-width: 100%;
  }

  .tag {
    font-size: 11px;
    padding: 8px 16px;
  }

  .tag-icon-svg {
    width: 16px;
    height: 16px;
  }

  #messages {
    max-height: 200px;
  }

  #messages.full-height {
    max-height: 500px;
  }

  .msg {
    font-size: 13px;
    padding: 15px 12px;
    margin: 15px 0;
    max-width: 90%;
  }

  .msg-icon {
    width: 36px;
    height: 36px;
  }

  .msg.user {
    margin-right: 50px;
  }

  .msg.bot {
    margin-left: 50px;
  }

  .msg.user .msg-icon {
    right: -46px;
  }

  .msg.bot .msg-icon {
    left: -46px;
    z-index: 1;
  }

  .msg.bot::before {
    left: -8px;
    width: 20px;
  }

  .msg.bot::after {
    left: -8px;
    width: 8px;
  }

  .chat-input-area {
    max-width: 100%;
    padding: 4px 8px 4px 15px;
  }

  .chat-input-area input {
    font-size: 13px;
    padding: 12px 10px;
  }

  .chat-input-area input::placeholder {
    font-size: 13px;
  }

  .send-btn img {
    width: 32px;
    height: 32px;
  }

  .new-conversation-btn {
    top: -12px;
    height: 26px;
    padding: 0 10px;
    font-size: 10px;
    gap: 4px;
    border-radius: 13px;
  }

  .new-conv-icon {
    width: 11px;
    height: 11px;
  }
}


/* Keep the brand and header in normal flow when viewport height is limited. */
.viewport-container {
  height: auto;
  min-height: calc(100vh - 50px);
  min-height: calc(100dvh - 50px);
}

.content-layout {
  box-sizing: border-box;
  min-height: calc(100vh - 50px);
  min-height: calc(100dvh - 50px);
  align-items: stretch;
}

.pato-column {
  flex: 0 1 350px;
  justify-content: space-between;
  margin-left: 0;
}

.logo-escudo {
  position: static;
  flex-shrink: 0;
  max-width: 100%;
  height: auto;
  margin-bottom: 16px;
}

.pato-img {
  max-width: 100%;
  height: auto;
  max-height: clamp(140px, calc(100dvh - 250px), 676px);
}

.chat-column {
  min-width: 0;
}

.main-title {
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.chat-card {
  width: 100%;
  height: clamp(280px, calc(100vh - 300px), 570px);
  height: clamp(280px, calc(100dvh - 300px), 570px);
  overflow-y: auto;
}

.new-conversation-btn {
  position: static;
  align-self: flex-end;
  flex-shrink: 0;
  max-width: 100%;
  margin-bottom: 12px;
}

.sugerencias > p {
  width: auto;
  max-width: 100%;
}

#messages {
  min-height: 0;
  flex: 1 1 auto;
}

#messages:empty {
  display: none;
}

.msg {
  box-sizing: border-box;
  overflow-wrap: anywhere;
}

.msg > span {
  min-width: 0;
  max-width: 100%;
}

.msg pre,
.msg table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.chat-input-area input {
  min-width: 0;
}

.chat-input-area:focus-within {
  outline: 3px solid #00b3f0;
  outline-offset: 2px;
}

button:focus-visible {
  outline: 3px solid #00b3f0;
  outline-offset: 3px;
}

@media (min-width: 901px) and (max-height: 650px) {
  .content-layout {
    padding-top: 16px;
    gap: 32px;
  }

  .main-header {
    padding: 8px 0 18px;
  }

  .main-title {
    font-size: clamp(28px, 2.8vw, 40px);
  }

  .main-subtitle {
    font-size: 14px;
  }

  .chat-header {
    margin-bottom: 20px;
  }
}

@media (min-width: 1600px) {
  .pato-column {
    flex-basis: 450px;
  }
}

@media (min-width: 2560px) {
  .chat-card {
    height: clamp(280px, calc(100dvh - 400px), 765px);
  }
}

@media (max-width: 900px) {
  .content-layout {
    align-items: stretch;
    gap: 0;
  }

  .pato-column {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    width: 100%;
    max-width: none;
  }

  .logo-escudo {
    width: 130px;
    height: 47px;
    margin-bottom: 0;
  }

  .pato-img {
    display: none;
  }

  .main-header {
    margin-top: 0;
  }

  .chat-card {
    height: clamp(280px, calc(100vh - 300px), 500px);
    height: clamp(280px, calc(100dvh - 300px), 500px);
    min-height: 280px;
    max-height: none;
  }
}


@media (min-width: 901px) and (max-height: 550px) {
  .content-layout {
    padding-top: 8px;
    padding-bottom: 12px;
  }

  .main-header {
    padding: 8px 0 12px;
  }

  .main-title {
    font-size: clamp(26px, 2.2vw, 34px);
  }

  .main-subtitle {
    font-size: 12px;
  }
}

@media (max-width: 900px) and (max-height: 700px) {
  .main-header {
    padding: 12px 8px;
    gap: 8px;
  }

  .main-title {
    font-size: 24px;
  }

  .main-subtitle {
    font-size: 12px;
    line-height: 1.3;
  }

  .chat-card {
    height: 280px;
  }
}

/* Match the composer to its card on wide desktop layouts as well. */
.chat-input-area {
  max-width: none;
}
