/* =========================================================
   Sinastree · estilos globales
   ========================================================= */

/* Base */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: "Montserrat", sans-serif;
  background: #ffffff;
  color: #1a1a1a;
  padding: 0 16px;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

h1 {
  font-size: 37px;
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
}

p {
  font-size: 17px;
  line-height: 1.7;
}

.content-narrow {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}


/* =========================================================
   Header
   ========================================================= */

.header {
  width: auto;
  margin-left: -16px;
  margin-right: -16px;
  padding: 22px 7%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
}

/*
  En la home, el header está dentro del hero.
  El hero ya compensa el padding del body con margin-left/right: -16px,
  así que el header NO debe volver a compensarlo.
*/
.index-page .hero .header {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}
.nav {
  display: flex;
  align-items: center;
  gap: 52px;
}

.nav a,
.logo a,
.social-icons a {
  color: #111;
  text-decoration: none;
}

.nav a {
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  transition: .2s ease;
}

.nav a:hover {
  color: #7780ed;
}

.logo a {
  font-family: "Quicksand", sans-serif;
  font-size: 47px;
  font-weight: 300;
  letter-spacing: 1px;
  line-height: 1;
}

.header-right {
  position: absolute;
  top: 50%;
  right: 7%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  transform: translateY(calc(-50% + 4px));
  z-index: 80;
}

.header .social-icons {
  display: none;
}


/* Nombre en header */

.header-name,
.header-name:visited,
.header-name:active,
.header-name:focus {
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.header-name:hover {
  color: #7780ed;
}


/* Icono usuario */

.account-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  line-height: 1;
  transition: .2s ease;
}

.account-icon:hover {
  color: #7780ed;
  transform: translateY(-1px);
}

.account-icon svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
  display: block;
}

.desktop-account-icon {
  display: inline-flex;
}

.mobile-account-icon {
  display: none;
}


/* Ocultar switch antiguo del header en toda la web */

.header .theme-switch {
  display: none !important;
}


/* Switch antiguo del header */

.theme-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
}

.theme-switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  background: #d6d6d6;
  border-radius: 999px;
  cursor: pointer;
  transition: .3s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  background: #ffffff;
  border-radius: 50%;
  transition: .3s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.22);
}

.theme-switch input:checked + .slider {
  background: #7780ed;
}

.theme-switch input:checked + .slider::before {
  transform: translateX(14px);
}


/* =========================================================
   Botones
   ========================================================= */

.cta-button,
.button {
  display: inline-block;
  background: #7780ed;
  color: #ffffff;
  text-decoration: none;
  padding: 17px 44px;
  border-radius: 40px;
  font-size: 17px;
  font-weight: 700;
  border: none;
  transition: .2s ease;
}

.cta-button:hover,
.button:hover {
  background: #4f58b8;
}

.button.secondary {
  background: transparent;
  color: #7780ed;
  border: 1.5px solid #7780ed;
}

.button.secondary:hover {
  background: #f3f4ff;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  border: 1.5px solid #b8b8d8;
  border-radius: 999px;
  background: transparent;
  color: #222;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: .25s ease;
}

.profile-button:hover {
  background: #f7f7ff;
  border-color: #7780ed;
  color: #7780ed;
}


/* =========================================================
   Footer común
   ========================================================= */

.site-footer {
  display: block !important;
  flex-shrink: 0;
  margin-top: 0;
  padding: 26px 20px 28px;
  background: #111111 !important;
  border-top: 1px solid #202020;
  color: #cccccc;
  text-align: center;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.index-page .site-footer {
  margin-left: -16px;
  margin-right: -16px;
}

.site-footer-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 54px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-footer-center {
  text-align: center;
}

.site-footer .footer-links {
  margin: 0 0 10px;
  font-size: 15px;
}

.site-footer .footer-links a {
  color: #cccccc;
  text-decoration: none;
  margin: 0 12px;
  transition: color 0.2s ease;
}

.site-footer .footer-links a:hover {
  color: #7780ed;
}

.site-footer .footer-copy {
  margin: 0;
  font-size: 14px;
  color: #999999;
}

.footer-copy-mobile {
  display: none;
}


/* Switch del footer */

.footer-theme {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.theme-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
}

.theme-icon {
  width: 12px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
  opacity: 0.92;
  font-family: Arial, Helvetica, sans-serif;
  font-variant-emoji: text;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.25s ease;
}

.theme-icon-moon {
  display: inline-block;
  color: #ffffff;
}

.theme-icon-sun {
  display: none;
  color: #222222;
}

.theme-toggle-track {
  width: 28px;
  height: 15px;
  border-radius: 999px;
  background: #7478ee;
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  box-shadow: 0 0 7px rgba(116, 120, 238, 0.26);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffffff;
  display: block;
  transform: translateX(13px);
  transition: transform 0.25s ease, background 0.25s ease;
}


/* Modo claro footer */

body.light-mode .site-footer {
  background: #f2eee6 !important;
  border-top: 1px solid rgba(20, 20, 20, 0.1);
  color: #222222;
}

body.light-mode .site-footer .footer-links a {
  color: #333333;
}

body.light-mode .site-footer .footer-links a:hover {
  color: #7478ee;
}

body.light-mode .site-footer .footer-copy {
  color: #666666;
}

body.light-mode .theme-toggle {
  color: #222222;
}

body.light-mode .theme-icon-moon {
  display: none;
}

body.light-mode .theme-icon-sun {
  display: inline-block;
  color: #8a7b63;
}

body.light-mode .theme-toggle-track {
  background: #ded8ca;
  box-shadow: 0 0 7px rgba(90, 70, 45, 0.10);
}

body.light-mode .theme-toggle-thumb {
  background: #ffffff;
  transform: translateX(0);
}


/* =========================================================
   Páginas interiores
   ========================================================= */

.legal-container,
.faq-container,
.how-container,
.thank-you,
.support-page,
main.container,
main > form.card {
  margin-top: 56px;
}

.legal-container h1,
.faq-container h1,
.how-container h1,
.thank-you h1,
.support-page h1,
main.container .hero h1,
.form-title {
  font-size: 47px;
  line-height: 1.15;
  font-weight: 600;
  color: #7780ed;
  margin-bottom: 18px;
}

.intro,
.form-intro,
main.container .hero p,
.support-page > p,
.thank-you > p {
  font-size: 20px;
  line-height: 1.7;
}


/* =========================================================
   Dark mode
   ========================================================= */

body.dark-mode {
  background: #111111;
  color: #f4f4f4;
}

body.dark-mode .logo a,
body.dark-mode .nav a,
body.dark-mode .social-icons a {
  color: #ffffff;
}

body.dark-mode .nav a:hover {
  color: #9ca3ff;
}

body.dark-mode .header-name {
  color: #ffffff;
}

body.dark-mode .header-name:hover {
  color: #d8dcff;
}

body.dark-mode .account-icon {
  color: #ffffff;
}

body.dark-mode .account-icon:hover {
  color: #d8dcff;
}

body.dark-mode .profile-button {
  color: #ffffff;
  border-color: rgba(255,255,255,.55);
  background: transparent;
}

body.dark-mode .profile-button:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.85);
  color: #ffffff;
}

body.dark-mode .intro,
body.dark-mode .updated,
body.dark-mode p {
  color: #d6d6d6;
}

body.dark-mode .legal-container h1,
body.dark-mode .faq-container h1,
body.dark-mode .how-container h1,
body.dark-mode .thank-you h1,
body.dark-mode .support-page h1,
body.dark-mode main.container .hero h1,
body.dark-mode .form-title {
  color: #7780ed;
}


/* =========================================================
   Light mode global SOLO para páginas interiores
   En la home index-page solo cambia el footer.
   ========================================================= */

body.light-mode:not(.index-page) {
  background: #f2eee6;
  color: #222222;
}

body.light-mode:not(.index-page) .header {
  background: transparent;
}

body.light-mode:not(.index-page) .logo a,
body.light-mode:not(.index-page) .nav a,
body.light-mode:not(.index-page) .account-icon,
body.light-mode:not(.index-page) .header-name {
  color: #222222;
}

body.light-mode:not(.index-page) .nav a:hover,
body.light-mode:not(.index-page) .account-icon:hover,
body.light-mode:not(.index-page) .header-name:hover {
  color: #7478ee;
}

body.light-mode:not(.index-page) p,
body.light-mode:not(.index-page) .intro,
body.light-mode:not(.index-page) .form-intro,
body.light-mode:not(.index-page) .support-page > p,
body.light-mode:not(.index-page) .thank-you > p {
  color: #333333;
}

body.light-mode:not(.index-page) h1,
body.light-mode:not(.index-page) h2,
body.light-mode:not(.index-page) h3 {
  color: #222222;
}

body.light-mode:not(.index-page) .legal-container h1,
body.light-mode:not(.index-page) .faq-container h1,
body.light-mode:not(.index-page) .how-container h1,
body.light-mode:not(.index-page) .thank-you h1,
body.light-mode:not(.index-page) .support-page h1,
body.light-mode:not(.index-page) main.container .hero h1,
body.light-mode:not(.index-page) .form-title {
  color: #7478ee;
}

body.light-mode:not(.index-page) .button.secondary {
  color: #7478ee;
  border-color: #7478ee;
}

body.light-mode:not(.index-page) .button.secondary:hover {
  background: #e8e5fb;
}

body.light-mode:not(.index-page) .profile-button {
  color: #222222;
  border-color: #aaa6c8;
}

body.light-mode:not(.index-page) .profile-button:hover {
  background: #e8e5fb;
  color: #7478ee;
  border-color: #7478ee;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 800px) {
  body {
    padding: 0 16px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 23px;
  }

  p {
    font-size: 16px;
  }

  .header {
    position: relative;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 7% 10px;
    text-align: center;
  }

  .logo {
    order: -1;
  }

  .logo a {
    font-size: 47px;
    line-height: 1;
  }

  .nav {
    justify-content: center;
    gap: 36px;
  }

  .nav a {
    font-size: 18px;
  }

 .header-right {
    position: absolute;
    top: 25px;
    right: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    transform: none;
    z-index: 80;
  }

  .header-right .theme-switch {
    display: none !important;
  }

  .header-right .header-name,
  .header-right .index-user-name,
  .index-user-name {
    display: none !important;
  }

  .header-right a[href="/mi-zona"]:not(.account-icon) {
    display: none !important;
  }

  .desktop-account-icon {
    display: none !important;
  }

  .mobile-account-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 1 !important;
  }

  .account-icon svg,
  .index-account-icon svg {
    width: 21px;
    height: 21px;
  }

  .profile-button {
    height: 34px;
    padding: 0 14px;
    font-size: 13px;
  }

  .legal-container,
  .faq-container,
  .how-container,
  .thank-you,
  .support-page,
  main.container,
  main > form.card {
    margin-top: 28px;
  }

  .legal-container h1,
  .faq-container h1,
  .how-container h1,
  .thank-you h1,
  .support-page h1,
  main.container .hero h1,
  .form-title {
    font-size: 38px;
    line-height: 1.2;
    margin-bottom: 14px;
  }

  .intro,
  .form-intro,
  main.container .hero p,
  .support-page > p,
  .thank-you > p {
    font-size: 18px;
    line-height: 1.55;
  }
  .site-footer {
    padding: 18px 20px 20px;
  }

  .index-page .site-footer {
    margin-left: -16px;
    margin-right: -16px;
  }

  .site-footer-inner {
    flex-direction: column;
    gap: 0;
    min-height: auto;
  }

  .site-footer .footer-links {
    margin-bottom: 6px;
    line-height: 1.55;
  }

  .site-footer .footer-links a {
    margin: 0 7px;
    font-size: 14px;
  }

  .site-footer .footer-copy {
    max-width: 320px;
    margin: 0 auto;
    font-size: 12.5px;
    line-height: 1.35;
  }

  .footer-copy-desktop {
    display: none;
  }

  .footer-copy-mobile {
    display: block;
  }

  .footer-theme {
    position: fixed;
    right: 18px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    top: auto;
    transform: none;
    justify-content: center;
    margin-top: 0;
    z-index: 999;
    padding: 7px 9px;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  }

  body.light-mode .footer-theme {
    background: rgba(242, 238, 230, 0.9);
    border: 1px solid rgba(20, 20, 20, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }

  .theme-icon {
    font-size: 13px;
  }
}

/* ================================
   Zona privada · Usuario
================================ */

.user-page {
  width: 100%;
  min-height: calc(100vh - 220px);
  padding: 72px 22px 90px;
}

.user-panel {
  width: min(960px, 100%);
  margin: 0 auto;
}

.user-panel .section-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.68;
}

.user-panel h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 0.95;
  margin: 0 0 22px;
  letter-spacing: -0.06em;
}

.user-intro {
  max-width: 720px;
  font-size: 1.02rem;
  line-height: 1.7;
  opacity: 0.82;
  margin-bottom: 34px;
}

.empty-state,
.proposal-card {
  border: 1px solid rgba(25, 25, 25, 0.12);
  border-radius: 28px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.04);
}

.empty-state h2,
.proposal-card h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  margin: 0 0 12px;
  letter-spacing: -0.04em;
}

.empty-state p,
.proposal-card p {
  line-height: 1.65;
  margin: 0;
}

.proposal-list {
  display: grid;
  gap: 22px;
}

.proposal-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px !important;
  background: rgba(25, 25, 25, 0.06);
}

.proposal-note {
  margin-top: 22px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(25, 25, 25, 0.045);
}

.proposal-note strong {
  display: block;
  margin-bottom: 8px;
}

.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.proposal-actions form {
  margin: 0;
}

.proposal-actions button,
.proposal-actions a.btn-primary,
.proposal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 46px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 0;
  background: #1f1f1f;
  color: #ffffff !important;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.proposal-actions button:hover,
.proposal-actions a.btn-primary:hover,
.proposal-link:hover {
  background: #4f58b8;
  color: #ffffff !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

.proposal-actions .btn-secondary {
  background: rgba(25, 25, 25, 0.08);
  color: inherit !important;
}

.proposal-actions .btn-secondary:hover {
  background: rgba(25, 25, 25, 0.13);
  color: inherit !important;
}

.proposal-response {
  margin-top: 24px !important;
  padding: 16px 18px;
  border-radius: 18px;
  font-weight: 600;
}

.proposal-response.accepted {
  background: rgba(90, 130, 90, 0.12);
}

.proposal-response.rejected {
  background: rgba(130, 90, 90, 0.12);
}

.proposal-profile {
  margin-top: 26px;
  padding: 24px 28px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(25, 25, 25, 0.08);
}

.proposal-profile h3 {
  font-size: 1.15rem;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}

.proposal-profile p + p {
  margin-top: 12px;
}

.proposal-profile strong {
  font-weight: 700;
}

/* ================================
   Fotos en propuestas
================================ */

.proposal-photo-block {
  width: 100%;
  max-width: 320px;
  margin: 6px 0 26px;
}

.proposal-photo-main {
  display: block;
  width: 100%;
  text-decoration: none;
}

.proposal-photo-main img {
  width: 100%;
  height: 390px;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 24px;
  background: rgba(25, 25, 25, 0.06);
}

.proposal-photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 11px;
}

.proposal-photo-thumb {
  width: 58px;
  height: 58px;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  opacity: 0.72;
  border: 2px solid transparent;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.proposal-photo-thumb:hover {
  opacity: 1;
  border-color: #7780ed;
  transform: translateY(-1px);
}

.proposal-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ================================
   Chat privado
================================ */

.chat-panel {
  width: min(960px, 100%);
}

.chat-panel h1 {
  max-width: 860px;
}

.chat-privacy-note {
  max-width: 760px;
  margin: 0 0 28px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(25, 25, 25, 0.045);
  font-size: 0.95rem;
  line-height: 1.6;
  color: inherit;
}

.chat-box {
  margin-top: 26px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 34px 0 38px;
}

.chat-message {
  max-width: 70%;
}

.chat-message.is-mine {
  align-self: flex-end;
  margin-left: auto;
  text-align: right;
}

.chat-message.is-theirs {
  align-self: flex-start;
  margin-right: auto;
}

.chat-message-bubble {
  padding: 15px 18px;
  border-radius: 22px;
  background: rgba(25, 25, 25, 0.065);
}

.chat-message-bubble p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
}

.chat-message.is-mine .chat-message-bubble {
  background: #1f1f1f;
  color: #ffffff;
  border-radius: 999px;
  padding: 15px 24px;
}

.chat-message.is-mine .chat-message-bubble p {
  color: #ffffff;
}

.chat-message.is-theirs .chat-message-bubble {
  color: inherit;
}

.chat-message-meta {
  margin-top: 7px;
  font-size: 0.78rem;
  opacity: 0.58;
}

.chat-form {
  margin-top: 34px;
  padding: 26px;
  border-radius: 26px;
  border: 1px solid rgba(25, 25, 25, 0.1);
  background: rgba(255, 255, 255, 0.38);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-form label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
}

.chat-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 150px;
  border: 1px solid rgba(25, 25, 25, 0.14);
  border-radius: 20px;
  padding: 16px;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  outline: none;
}

.chat-form textarea:focus {
  border-color: #7780ed;
  box-shadow: 0 0 0 3px rgba(119, 128, 237, 0.15);
}

.chat-form button,
.chat-form .btn-primary {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 13px 22px;
  border-radius: 999px;
  border: 0;
  background: #1f1f1f;
  color: #ffffff;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chat-form button:hover,
.chat-form .btn-primary:hover {
  background: #4f58b8;
  transform: translateY(-1px);
}

.chat-secondary-actions {
  margin-top: 24px;
}

.chat-secondary-actions a {
  font-size: 0.95rem;
  text-decoration: none;
  opacity: 0.72;
}

.chat-secondary-actions a:hover {
  opacity: 1;
  color: #7780ed;
}

/* ================================
   Modo oscuro · zona privada
================================ */

body.dark-mode .empty-state,
body.dark-mode .proposal-card {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

body.dark-mode .proposal-status,
body.dark-mode .proposal-note,
body.dark-mode .proposal-profile,
body.dark-mode .proposal-actions .btn-secondary,
body.dark-mode .chat-privacy-note,
body.dark-mode .chat-form,
body.dark-mode .chat-message-bubble {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode .proposal-actions button,
body.dark-mode .proposal-actions a.btn-primary,
body.dark-mode .proposal-link,
body.dark-mode .chat-form button,
body.dark-mode .chat-form .btn-primary {
  background: #f2f0ea;
  color: #181818 !important;
}

body.dark-mode .proposal-actions button:hover,
body.dark-mode .proposal-actions a.btn-primary:hover,
body.dark-mode .proposal-link:hover,
body.dark-mode .chat-form button:hover,
body.dark-mode .chat-form .btn-primary:hover {
  background: #d8dcff;
  color: #181818 !important;
}

body.dark-mode .proposal-actions .btn-secondary {
  color: #ffffff !important;
}

body.dark-mode .proposal-response.accepted {
  background: rgba(160, 210, 160, 0.12);
}

body.dark-mode .proposal-response.rejected {
  background: rgba(220, 160, 160, 0.12);
}

body.dark-mode .proposal-photo-main img,
body.dark-mode .proposal-photo-thumb {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .chat-message.is-mine .chat-message-bubble {
  background: #f2f0ea;
  color: #181818;
}

body.dark-mode .chat-message.is-mine .chat-message-bubble p {
  color: #181818;
}

body.dark-mode .chat-message.is-theirs .chat-message-bubble {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f4;
}

body.dark-mode .chat-message.is-theirs .chat-message-bubble p {
  color: #f4f4f4;
}

body.dark-mode .chat-message-meta {
  color: rgba(244, 244, 244, 0.65);
}

body.dark-mode .chat-form textarea {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f4f4f4;
}

body.dark-mode .chat-form textarea::placeholder {
  color: rgba(244, 244, 244, 0.48);
}

/* ================================
   Responsive · zona privada
================================ */

@media (max-width: 720px) {
  .user-page {
    padding: 46px 18px 72px;
  }

  .empty-state,
  .proposal-card {
    border-radius: 24px;
    padding: 24px;
  }

  .proposal-actions {
    flex-direction: column;
  }

  .proposal-actions button,
  .proposal-actions a.btn-primary,
  .proposal-link,
  .chat-form button,
  .chat-form .btn-primary {
    width: 100%;
  }

  .proposal-profile {
    padding: 20px;
    border-radius: 22px;
  }

  .proposal-photo-block {
    max-width: 100%;
  }

  .proposal-photo-main img {
    height: 360px;
    border-radius: 22px;
  }

  .proposal-photo-thumb {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .chat-message {
    max-width: 88%;
  }

  .chat-message.is-mine .chat-message-bubble {
    border-radius: 24px;
  }

  .chat-form {
    padding: 20px;
    border-radius: 22px;
  }
}

/* ================================
   Chat · refinamiento final
================================ */

.chat-header-soft {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  margin-bottom: 28px !important;
}

.chat-user-photo {
  width: 62px !important;
  height: 62px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.chat-header-soft .section-label {
  margin: 0 !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  opacity: 0.72 !important;
  color: rgba(244, 244, 244, 0.72) !important;
}

.chat-subtitle-soft,
.chat-panel > h1,
.chat-title-soft,
.chat-panel .user-intro,
.chat-privacy-note {
  display: none !important;
}

/* Mensaje propio: lila pastel */
.chat-message.is-mine .chat-message-bubble,
body.dark-mode .chat-message.is-mine .chat-message-bubble {
  background: #b9acd9 !important;
  color: #211c2b !important;
  border-radius: 28px !important;
  padding: 15px 24px !important;
}

.chat-message.is-mine .chat-message-bubble,
.chat-message.is-mine .chat-message-bubble *,
.chat-message.is-mine .chat-message-bubble p,
body.dark-mode .chat-message.is-mine .chat-message-bubble,
body.dark-mode .chat-message.is-mine .chat-message-bubble *,
body.dark-mode .chat-message.is-mine .chat-message-bubble p {
  color: #211c2b !important;
}

/* Mensaje de la otra persona: verde salvia suave */
.chat-message.is-theirs .chat-message-bubble,
body.dark-mode .chat-message.is-theirs .chat-message-bubble {
  background: #b8c7b2 !important;
  color: #1f281f !important;
  border-radius: 28px !important;
  padding: 15px 24px !important;
}

.chat-message.is-theirs .chat-message-bubble,
.chat-message.is-theirs .chat-message-bubble *,
.chat-message.is-theirs .chat-message-bubble p,
body.dark-mode .chat-message.is-theirs .chat-message-bubble,
body.dark-mode .chat-message.is-theirs .chat-message-bubble *,
body.dark-mode .chat-message.is-theirs .chat-message-bubble p {
  color: #1f281f !important;
}

/* Day mode */
body.light-mode .chat-header-soft .section-label {
  color: rgba(34, 34, 34, 0.58) !important;
}

body.light-mode .chat-user-photo {
  border-color: rgba(34, 34, 34, 0.12) !important;
}

body.light-mode .chat-message.is-mine .chat-message-bubble {
  background: #cfc6e8 !important;
  color: #211c2b !important;
}

body.light-mode .chat-message.is-mine .chat-message-bubble,
body.light-mode .chat-message.is-mine .chat-message-bubble *,
body.light-mode .chat-message.is-mine .chat-message-bubble p {
  color: #211c2b !important;
}

body.light-mode .chat-message.is-theirs .chat-message-bubble {
  background: #d7e0d2 !important;
  color: #1f281f !important;
}

body.light-mode .chat-message.is-theirs .chat-message-bubble,
body.light-mode .chat-message.is-theirs .chat-message-bubble *,
body.light-mode .chat-message.is-theirs .chat-message-bubble p {
  color: #1f281f !important;
}

/* Formulario y botón */
body.dark-mode .chat-form {
  background: rgba(255, 255, 255, 0.055) !important;
}

body.light-mode .chat-form {
  background: rgba(255, 255, 255, 0.48) !important;
}

body.dark-mode .chat-form button,
body.dark-mode .chat-form .btn-primary,
body.light-mode .chat-form button,
body.light-mode .chat-form .btn-primary {
  background: #9e8acb !important;
  color: #ffffff !important;
}

body.dark-mode .chat-form button:hover,
body.dark-mode .chat-form .btn-primary:hover,
body.light-mode .chat-form button:hover,
body.light-mode .chat-form .btn-primary:hover {
  background: #8b75bd !important;
}

@media (max-width: 720px) {
  .chat-header-soft {
    gap: 13px !important;
    margin-bottom: 24px !important;
  }

  .chat-user-photo {
    width: 54px !important;
    height: 54px !important;
  }

  .chat-message {
    max-width: 88% !important;
  }

  .chat-message.is-mine .chat-message-bubble,
  .chat-message.is-theirs .chat-message-bubble {
    border-radius: 24px !important;
  }
}

/* ================================
   Propuestas · intro discreta
================================ */

.proposals-intro {
  width: 100% !important;
  max-width: none !important;
  margin: 18px 0 56px !important;
  font-size: 0.82rem !important;
  line-height: 1.45 !important;
  font-weight: 400 !important;
  opacity: 0.62 !important;
  white-space: nowrap !important;
}

@media (max-width: 980px) {
  .proposals-intro {
    white-space: normal !important;
    max-width: 720px !important;
  }
}

/* ================================
   Header · mensajes y cuenta
   Ajuste final: móvil con globo + menú Mi zona / Mis propuestas
================================ */

.nav-mobile-link {
  display: none;
}

.nav-desktop-link {
  display: inline-flex;
}

.header-right {
  position: absolute;
  top: 50%;
  right: 7%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  transform: translateY(calc(-50% + 4px));
  z-index: 80;
}

.header-messages-link,
.header-messages-icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: inherit;
  text-decoration: none;
  line-height: 1;
  opacity: 0.9;
  white-space: nowrap;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.header-messages-link:hover,
.header-messages-icon-link:hover {
  opacity: 1;
  color: #7780ed;
}

.header-messages-icon {
  width: 30px;
  height: 30px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.95;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(7px);
}

.header-account-text {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.header-account-text:hover {
  color: #7780ed;
  opacity: 1;
}

.desktop-account-text {
  display: inline-flex;
}

.mobile-account-icon,
.account-icon.mobile-account-icon,
.desktop-account-icon {
  display: none !important;
}

.header-messages-badge {
  position: absolute;
  top: -7px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #b9acd9;
  color: #211c2b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
}

body.dark-mode .header-messages-badge {
  background: #b9acd9;
  color: #211c2b;
}

body.light-mode .header-messages-badge {
  background: #9e8acb;
  color: #ffffff;
}

body.dark-mode .header-account-text,
body.dark-mode .header-messages-link,
body.dark-mode .header-messages-icon-link {
  color: #ffffff;
}

body.dark-mode .header-account-text:hover,
body.dark-mode .header-messages-link:hover,
body.dark-mode .header-messages-icon-link:hover {
  color: #d8dcff;
}

body.light-mode:not(.index-page) .header-account-text,
body.light-mode:not(.index-page) .header-messages-link,
body.light-mode:not(.index-page) .header-messages-icon-link {
  color: #222222;
}

body.light-mode:not(.index-page) .header-account-text:hover,
body.light-mode:not(.index-page) .header-messages-link:hover,
body.light-mode:not(.index-page) .header-messages-icon-link:hover {
  color: #7478ee;
}

/* MÓVIL */
@media (max-width: 800px) {
  .nav-desktop-link {
    display: none !important;
  }

  .nav-mobile-link {
    display: inline-flex !important;
  }

  .nav {
    justify-content: center;
    gap: 34px;
  }

  .nav a {
    font-size: 17px;
  }

  .header-right {
    position: absolute;
    top: 25px;
    right: 36px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    transform: none !important;
    z-index: 80;
  }

  .desktop-account-text,
  .header-account-text,
  .mobile-account-icon,
  .account-icon.mobile-account-icon,
  .desktop-account-icon {
    display: none !important;
  }

  .header-messages-link,
  .header-messages-icon-link {
    display: inline-flex !important;
    width: 32px !important;
    height: 32px !important;
    opacity: 0.92;
  }

  .header-messages-icon {
    width: 28px !important;
    height: 28px !important;
    transform: translateY(4px) !important;
  }

  .header-messages-badge {
    top: -5px;
    right: -7px;
  }
}


/* ================================
   Mensajes · bandeja de chats
================================ */

.messages-panel {
  width: min(860px, 100%) !important;
}

.messages-panel .section-label {
  margin-bottom: 28px !important;
}

.messages-list {
  display: grid !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 760px !important;
}

.messages-card {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  width: 100% !important;
  padding: 16px 18px !important;
  border-radius: 22px !important;
  text-decoration: none !important;
  background: rgba(255, 255, 255, 0.38) !important;
  border: 1px solid rgba(25, 25, 25, 0.1) !important;
  overflow: hidden !important;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.messages-card:hover {
  transform: translateY(-1px) !important;
  background: rgba(255, 255, 255, 0.52) !important;
  border-color: rgba(119, 128, 237, 0.32) !important;
}

.messages-avatar {
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  flex: 0 0 54px !important;
  background: #b9acd9 !important;
  color: #211c2b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.15rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

.messages-avatar img {
  width: 54px !important;
  height: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  border-radius: 50% !important;
}

.messages-content {
  min-width: 0 !important;
  flex: 1 !important;
}

.messages-topline {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin-bottom: 4px !important;
}

.messages-topline h2 {
  margin: 0 !important;
  font-size: 1rem !important;
  line-height: 1.25 !important;
  letter-spacing: -0.02em !important;
  text-decoration: none !important;
}

.messages-preview {
  margin: 0 !important;
  font-size: 0.88rem !important;
  line-height: 1.45 !important;
  opacity: 0.72 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.messages-date {
  margin: 4px 0 0 !important;
  font-size: 0.74rem !important;
  line-height: 1.3 !important;
  opacity: 0.45 !important;
}

.messages-badge {
  min-width: 21px !important;
  height: 21px !important;
  padding: 0 7px !important;
  border-radius: 999px !important;
  background: #b9acd9 !important;
  color: #211c2b !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
}

body.dark-mode .messages-card {
  background: rgba(255, 255, 255, 0.055) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode .messages-card:hover {
  background: rgba(255, 255, 255, 0.085) !important;
  border-color: rgba(185, 172, 217, 0.38) !important;
}

body.dark-mode .messages-badge,
body.dark-mode .messages-avatar {
  background: #b9acd9 !important;
  color: #211c2b !important;
}

body.light-mode .messages-badge,
body.light-mode .messages-avatar {
  background: #9e8acb !important;
  color: #ffffff !important;
}

@media (max-width: 720px) {
  .messages-card {
    padding: 14px !important;
    gap: 13px !important;
    border-radius: 20px !important;
  }

  .messages-avatar,
  .messages-avatar img {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    flex-basis: 50px !important;
  }

  .messages-preview {
    white-space: normal !important;
  }
}

/* ================================
   Chat · cápsula compacta con scroll interno
================================ */

.chat-panel {
  width: min(760px, 100%) !important;
  margin: 0 auto !important;
}

.chat-header-soft {
  width: min(640px, 100%) !important;
  margin: 0 auto 22px !important;
}

.chat-capsule {
  width: min(640px, 100%) !important;
  margin: 22px auto 0 !important;
  padding: 20px !important;
  border-radius: 34px !important;
  background: rgba(255, 255, 255, 0.075) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.26) !important;
}

body.light-mode .chat-capsule {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(80, 70, 110, 0.13) !important;
  box-shadow: 0 22px 60px rgba(80, 70, 110, 0.1) !important;
}

.chat-box {
  height: 520px !important;
  max-height: 520px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 8px 14px 14px 8px !important;
  margin-top: 0 !important;
  scroll-behavior: smooth !important;
}

.chat-messages {
  gap: 14px !important;
  margin: 14px 0 10px !important;
}

.chat-message {
  max-width: 78% !important;
}

.chat-message-bubble {
  padding: 13px 18px !important;
  border-radius: 24px !important;
}

.chat-message-bubble p {
  font-size: 0.92rem !important;
  line-height: 1.45 !important;
}

.chat-message-meta {
  font-size: 0.7rem !important;
  margin-top: 5px !important;
  opacity: 0.48 !important;
}

.chat-box::-webkit-scrollbar {
  width: 10px !important;
}

.chat-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 999px !important;
}

.chat-box::-webkit-scrollbar-thumb {
  background: rgba(185, 172, 217, 0.55) !important;
  border-radius: 999px !important;
}

.chat-box::-webkit-scrollbar-thumb:hover {
  background: rgba(185, 172, 217, 0.78) !important;
}

body.light-mode .chat-box::-webkit-scrollbar-track {
  background: rgba(80, 70, 110, 0.08) !important;
}

body.light-mode .chat-box::-webkit-scrollbar-thumb {
  background: rgba(158, 138, 203, 0.48) !important;
}

body.light-mode .chat-box::-webkit-scrollbar-thumb:hover {
  background: rgba(158, 138, 203, 0.72) !important;
}

.chat-form {
  width: min(640px, 100%) !important;
  margin: 22px auto 0 !important;
  padding: 20px !important;
  border-radius: 28px !important;
}

.chat-form textarea {
  min-height: 110px !important;
  max-height: 180px !important;
  border-radius: 20px !important;
}

.chat-secondary-actions {
  width: min(640px, 100%) !important;
  margin: 18px auto 0 !important;
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  flex-wrap: wrap !important;
}

.chat-user-photo-link {
  display: inline-flex !important;
  width: 62px !important;
  height: 62px !important;
  border-radius: 50% !important;
  text-decoration: none !important;
  flex: 0 0 auto !important;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.chat-user-photo-link:hover {
  transform: translateY(-1px) scale(1.03);
  opacity: 0.92;
}

/* ================================
   Perfil visible desde chat
================================ */

.profile-view-panel {
  width: min(760px, 100%) !important;
  margin: 0 auto !important;
}

.profile-view-panel > .section-label {
  width: min(640px, 100%) !important;
  margin: 0 auto 18px !important;
}

.profile-view-card {
  width: min(640px, 100%) !important;
  margin: 0 auto !important;
  padding: 30px !important;
  border-radius: 34px !important;
  background: rgba(255, 255, 255, 0.075) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.24) !important;
  overflow: hidden !important;
}

body.light-mode .profile-view-card {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid rgba(80, 70, 110, 0.13) !important;
  box-shadow: 0 22px 60px rgba(80, 70, 110, 0.1) !important;
}

.profile-view-header {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  text-align: center !important;
  margin-bottom: 28px !important;
}

.profile-view-header > div {
  width: 100% !important;
  text-align: center !important;
}

.profile-photo-open,
.profile-gallery-open {
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 0 !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer !important;
  display: block !important;
}

.profile-photo-open {
  width: 148px !important;
  height: 148px !important;
  min-width: 148px !important;
  max-width: 148px !important;
  min-height: 148px !important;
  max-height: 148px !important;
  flex: 0 0 148px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  margin: 0 auto !important;
}

.profile-view-main-photo,
.profile-photo-open .profile-view-main-photo {
  width: 148px !important;
  height: 148px !important;
  min-width: 148px !important;
  max-width: 148px !important;
  min-height: 148px !important;
  max-height: 148px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  flex: 0 0 148px !important;
  border: 0 !important;
  background: transparent !important;
}

.profile-photo-open:hover,
.profile-gallery-open:hover {
  transform: translateY(-1px) scale(1.02) !important;
  opacity: 0.92 !important;
}

.profile-view-header h1 {
  font-size: clamp(1.8rem, 3.2vw, 2.45rem) !important;
  line-height: 1 !important;
  letter-spacing: -0.04em !important;
  margin: 4px 0 0 !important;
  text-align: center !important;
}

.profile-view-city {
  margin: 4px 0 0 !important;
  font-size: 0.92rem !important;
  opacity: 0.62 !important;
  text-align: center !important;
}

.profile-view-gallery {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)) !important;
  gap: 12px !important;
  margin: 18px 0 28px !important;
}

.profile-gallery-open {
  width: 100% !important;
  height: 130px !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.profile-view-gallery img,
.profile-gallery-open img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 20px !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

.profile-view-info {
  display: grid !important;
  gap: 14px !important;
}

.profile-view-field {
  padding: 17px 18px !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

body.light-mode .profile-view-field {
  background: rgba(80, 70, 110, 0.055) !important;
}

.profile-view-field strong {
  display: block !important;
  margin-bottom: 7px !important;
  font-size: 0.76rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  opacity: 0.58 !important;
}

.profile-view-field p {
  margin: 0 !important;
  font-size: 0.94rem !important;
  line-height: 1.6 !important;
}

/* ================================
   Perfil · galería flotante
================================ */

.profile-lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
}

.profile-lightbox.is-open {
  display: flex !important;
}

.profile-lightbox-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.72) !important;
  backdrop-filter: blur(10px) !important;
}

.profile-lightbox-card {
  position: relative !important;
  width: min(860px, 94vw) !important;
  max-height: 88vh !important;
  padding: 22px !important;
  border-radius: 34px !important;
  background: rgba(24, 24, 24, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.profile-lightbox-image {
  max-width: 100% !important;
  max-height: 76vh !important;
  object-fit: contain !important;
  border-radius: 24px !important;
  display: block !important;
}

.profile-lightbox-close {
  position: absolute !important;
  top: 12px !important;
  right: 16px !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  font-size: 28px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 2 !important;
}

.profile-lightbox-arrow {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: rgba(255, 255, 255, 0.14) !important;
  color: #ffffff !important;
  font-size: 38px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 2 !important;
}

.profile-lightbox-prev {
  left: 16px !important;
}

.profile-lightbox-next {
  right: 16px !important;
}

.profile-lightbox-close:hover,
.profile-lightbox-arrow:hover {
  background: rgba(185, 172, 217, 0.42) !important;
}

.profile-lightbox-counter {
  position: absolute !important;
  bottom: 12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  font-size: 0.8rem !important;
  color: rgba(255, 255, 255, 0.72) !important;
}

body.lightbox-open {
  overflow: hidden !important;
}

@media (max-width: 720px) {
  .chat-panel {
    width: 100% !important;
  }

  .chat-header-soft,
  .chat-capsule,
  .chat-form,
  .chat-secondary-actions {
    width: 100% !important;
  }

  .chat-capsule {
    padding: 14px !important;
    border-radius: 26px !important;
  }

  .chat-box {
    height: 430px !important;
    max-height: 430px !important;
    padding: 6px 10px 12px 4px !important;
  }

  .chat-message {
    max-width: 86% !important;
  }

  .chat-message-bubble {
    padding: 12px 16px !important;
  }

  .chat-form {
    padding: 16px !important;
  }

  .chat-user-photo-link {
    width: 54px !important;
    height: 54px !important;
  }

  .profile-view-card {
    width: 100% !important;
    padding: 18px !important;
    border-radius: 28px !important;
  }

  .profile-view-header {
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  .profile-photo-open,
  .profile-view-main-photo,
  .profile-photo-open .profile-view-main-photo {
    width: 124px !important;
    height: 124px !important;
    min-width: 124px !important;
    max-width: 124px !important;
    min-height: 124px !important;
    max-height: 124px !important;
    flex-basis: 124px !important;
  }

  .profile-view-header h1 {
    font-size: 1.9rem !important;
  }

  .profile-view-gallery {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }

  .profile-gallery-open {
    height: 96px !important;
    border-radius: 16px !important;
  }

  .profile-view-gallery img,
  .profile-gallery-open img {
    border-radius: 16px !important;
  }

  .profile-lightbox {
    padding: 14px !important;
  }

  .profile-lightbox-card {
    width: 96vw !important;
    padding: 14px !important;
    border-radius: 26px !important;
  }

  .profile-lightbox-image {
    max-height: 74vh !important;
    border-radius: 20px !important;
  }

  .profile-lightbox-arrow {
    width: 36px !important;
    height: 36px !important;
    font-size: 32px !important;
  }

  .profile-lightbox-prev {
    left: 8px !important;
  }

  .profile-lightbox-next {
    right: 8px !important;
  }
}


/* ================================
   Corrección final · modo día/noche footer
   Acepta la clase tanto en body como en html
================================ */

body.dark-mode .site-footer,
html.dark-mode body .site-footer {
  background: #111111 !important;
  border-top-color: #202020 !important;
  color: #cccccc !important;
}

body.dark-mode .site-footer .footer-links a,
html.dark-mode body .site-footer .footer-links a {
  color: #cccccc !important;
}

body.dark-mode .site-footer .footer-copy,
html.dark-mode body .site-footer .footer-copy {
  color: #999999 !important;
}

body.dark-mode .theme-toggle,
html.dark-mode body .theme-toggle {
  color: #ffffff !important;
}

body.dark-mode .theme-icon-moon,
html.dark-mode body .theme-icon-moon {
  display: inline-block !important;
  color: #ffffff !important;
}

body.dark-mode .theme-icon-sun,
html.dark-mode body .theme-icon-sun {
  display: none !important;
}

body.dark-mode .theme-toggle-track,
html.dark-mode body .theme-toggle-track {
  background: #7478ee !important;
  box-shadow: 0 0 7px rgba(116, 120, 238, 0.26) !important;
}

body.dark-mode .theme-toggle-thumb,
html.dark-mode body .theme-toggle-thumb {
  background: #ffffff !important;
  transform: translateX(13px) !important;
}

body.light-mode .site-footer,
html.light-mode body .site-footer {
  background: #f2eee6 !important;
  border-top-color: rgba(20, 20, 20, 0.1) !important;
  color: #222222 !important;
}

body.light-mode .site-footer .footer-links a,
html.light-mode body .site-footer .footer-links a {
  color: #333333 !important;
}

body.light-mode .site-footer .footer-links a:hover,
html.light-mode body .site-footer .footer-links a:hover {
  color: #7478ee !important;
}

body.light-mode .site-footer .footer-copy,
html.light-mode body .site-footer .footer-copy {
  color: #666666 !important;
}

body.light-mode .theme-toggle,
html.light-mode body .theme-toggle {
  color: #222222 !important;
}

body.light-mode .theme-icon-moon,
html.light-mode body .theme-icon-moon {
  display: none !important;
}

body.light-mode .theme-icon-sun,
html.light-mode body .theme-icon-sun {
  display: inline-block !important;
  color: #8a7b63 !important;
}

body.light-mode .theme-toggle-track,
html.light-mode body .theme-toggle-track {
  background: #ded8ca !important;
  box-shadow: 0 0 7px rgba(90, 70, 45, 0.10) !important;
}

body.light-mode .theme-toggle-thumb,
html.light-mode body .theme-toggle-thumb {
  background: #ffffff !important;
  transform: translateX(0) !important;
}

@media (max-width: 800px) {
  body.light-mode .footer-theme,
  html.light-mode body .footer-theme {
    background: rgba(242, 238, 230, 0.9) !important;
    border: 1px solid rgba(20, 20, 20, 0.1) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  }

  body.dark-mode .footer-theme,
  html.dark-mode body .footer-theme {
    background: rgba(17, 17, 17, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22) !important;
  }
}

/* ================================
   Corrección extra · footer día/noche estable
   Mantener al final del archivo
================================ */

body.light-mode .site-footer,
html.light-mode body .site-footer,
body[data-theme="light"] .site-footer {
  background: #f2eee6 !important;
  border-top-color: rgba(20, 20, 20, 0.1) !important;
  color: #222222 !important;
}

body.light-mode .site-footer .footer-links a,
html.light-mode body .site-footer .footer-links a,
body[data-theme="light"] .site-footer .footer-links a {
  color: #333333 !important;
}

body.light-mode .site-footer .footer-copy,
html.light-mode body .site-footer .footer-copy,
body[data-theme="light"] .site-footer .footer-copy {
  color: #666666 !important;
}

body.light-mode .theme-toggle,
html.light-mode body .theme-toggle,
body[data-theme="light"] .theme-toggle {
  color: #222222 !important;
}

body.light-mode .theme-icon-moon,
html.light-mode body .theme-icon-moon,
body[data-theme="light"] .theme-icon-moon {
  display: none !important;
}

body.light-mode .theme-icon-sun,
html.light-mode body .theme-icon-sun,
body[data-theme="light"] .theme-icon-sun {
  display: inline-block !important;
  color: #8a7b63 !important;
}

body.light-mode .theme-toggle-track,
html.light-mode body .theme-toggle-track,
body[data-theme="light"] .theme-toggle-track {
  background: #ded8ca !important;
  box-shadow: 0 0 7px rgba(90, 70, 45, 0.10) !important;
}

body.light-mode .theme-toggle-thumb,
html.light-mode body .theme-toggle-thumb,
body[data-theme="light"] .theme-toggle-thumb {
  background: #ffffff !important;
  transform: translateX(0) !important;
}

body.dark-mode .site-footer,
html.dark-mode body .site-footer,
body[data-theme="dark"] .site-footer {
  background: #111111 !important;
  border-top-color: #202020 !important;
  color: #cccccc !important;
}

body.dark-mode .site-footer .footer-links a,
html.dark-mode body .site-footer .footer-links a,
body[data-theme="dark"] .site-footer .footer-links a {
  color: #cccccc !important;
}

body.dark-mode .site-footer .footer-copy,
html.dark-mode body .site-footer .footer-copy,
body[data-theme="dark"] .site-footer .footer-copy {
  color: #999999 !important;
}

body.dark-mode .theme-toggle,
html.dark-mode body .theme-toggle,
body[data-theme="dark"] .theme-toggle {
  color: #ffffff !important;
}

body.dark-mode .theme-icon-moon,
html.dark-mode body .theme-icon-moon,
body[data-theme="dark"] .theme-icon-moon {
  display: inline-block !important;
  color: #ffffff !important;
}

body.dark-mode .theme-icon-sun,
html.dark-mode body .theme-icon-sun,
body[data-theme="dark"] .theme-icon-sun {
  display: none !important;
}

body.dark-mode .theme-toggle-track,
html.dark-mode body .theme-toggle-track,
body[data-theme="dark"] .theme-toggle-track {
  background: #7478ee !important;
  box-shadow: 0 0 7px rgba(116, 120, 238, 0.26) !important;
}

body.dark-mode .theme-toggle-thumb,
html.dark-mode body .theme-toggle-thumb,
body[data-theme="dark"] .theme-toggle-thumb {
  background: #ffffff !important;
  transform: translateX(13px) !important;
}

/* ================================
   Ajuste final · alineación nombre header
   Mantener al final del archivo
================================ */

.header-account-text {
  display: inline-flex !important;
  align-items: center !important;
  transform: translateY(4px) !important;
}

@media (max-width: 800px) {
  .header-account-text,
  .desktop-account-text {
    display: none !important;
    transform: none !important;
  }
}



/* =========================================================
   HOTFIX FINAL · Header web/móvil + Mensajes elegante
   Mantener SIEMPRE al final del archivo
   ========================================================= */

/* WEB: en el menú superior solo deben verse Descubre y Cómo funciona */
@media screen and (min-width: 801px) {
  .header .nav .nav-desktop-link,
  header.header nav.nav .nav-desktop-link,
  .header .nav a[href="/descubre"],
  .header .nav a[href="/como-funciona"] {
    display: inline-flex !important;
  }

  .header .nav .nav-mobile-link,
  header.header nav.nav .nav-mobile-link,
  .header .nav a[href="/mi-zona"],
  .header .nav a[href="/usuario/propuestas.php"],
  .header .nav a[href="/login"]:not(.header-account-text):not(.header-messages-link):not(.header-messages-icon-link) {
    display: none !important;
  }
}

/* MÓVIL: en el menú solo deben verse Mi zona y Mis propuestas */
@media screen and (max-width: 800px) {
  .header .nav .nav-desktop-link,
  header.header nav.nav .nav-desktop-link,
  .header .nav a[href="/descubre"],
  .header .nav a[href="/como-funciona"] {
    display: none !important;
  }

  .header .nav .nav-mobile-link,
  header.header nav.nav .nav-mobile-link,
  .header .nav a[href="/mi-zona"],
  .header .nav a[href="/usuario/propuestas.php"] {
    display: inline-flex !important;
  }

  .header .nav {
    justify-content: center !important;
    gap: 30px !important;
  }

  .header .nav a {
    font-size: 16px !important;
  }
}

/* Mensajes: reducir fuerza visual de títulos */
.user-page .messages-panel {
  width: min(860px, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.user-page .messages-panel .section-label {
  margin-bottom: 14px !important;
  font-size: 0.68rem !important;
  line-height: 1.2 !important;
  letter-spacing: 0.2em !important;
  font-weight: 500 !important;
  opacity: 0.52 !important;
}

.user-page .messages-panel h1,
.user-page .messages-panel .messages-title,
main.user-page .messages-panel h1.messages-title {
  font-size: clamp(1.95rem, 3.2vw, 2.85rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.045em !important;
  font-weight: 600 !important;
  margin: 0 0 16px !important;
}

.user-page .messages-panel .messages-intro,
.user-page .messages-panel .user-intro.messages-intro {
  max-width: 680px !important;
  margin-bottom: 38px !important;
  font-size: 0.94rem !important;
  line-height: 1.7 !important;
  font-weight: 400 !important;
  opacity: 0.64 !important;
}

.user-page .messages-panel .empty-state {
  padding: 32px 36px !important;
  border-radius: 28px !important;
}

.user-page .messages-panel .empty-state h2 {
  font-size: clamp(1.25rem, 2vw, 1.65rem) !important;
  line-height: 1.18 !important;
  letter-spacing: -0.035em !important;
  font-weight: 600 !important;
  margin: 0 0 12px !important;
}

.user-page .messages-panel .empty-state p {
  font-size: 0.94rem !important;
  line-height: 1.65 !important;
  opacity: 0.72 !important;
}

.user-page .messages-panel .proposal-actions a,
.user-page .messages-panel .proposal-actions .btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-height: 40px !important;
  padding: 11px 19px !important;
  border-radius: 999px !important;
  background: #7780ed !important;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
}

@media screen and (max-width: 800px) {
  .user-page .messages-panel h1,
  .user-page .messages-panel .messages-title,
  main.user-page .messages-panel h1.messages-title {
    font-size: 2rem !important;
    letter-spacing: -0.04em !important;
  }

  .user-page .messages-panel .messages-intro,
  .user-page .messages-panel .user-intro.messages-intro {
    font-size: 0.9rem !important;
    margin-bottom: 28px !important;
  }

  .user-page .messages-panel .empty-state {
    padding: 24px !important;
    border-radius: 24px !important;
  }

  .user-page .messages-panel .empty-state h2 {
    font-size: 1.35rem !important;
  }
}


/* =========================================================
   Mensajes · cápsula prolija final
   Mantener al final del archivo
   ========================================================= */

.user-page .messages-panel {
  width: min(840px, 100%) !important;
  margin: 0 auto !important;
}

/* Respira como el resto de páginas privadas */
.user-page .messages-panel .section-label {
  margin-bottom: 13px !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  opacity: 0.52 !important;
}

/* Título menos landing / más zona privada */
.user-page .messages-panel h1,
.user-page .messages-panel .messages-title,
main.user-page .messages-panel h1.messages-title {
  max-width: 720px !important;
  font-size: clamp(2.05rem, 3.2vw, 3rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.045em !important;
  font-weight: 600 !important;
  margin: 0 0 17px !important;
}

.user-page .messages-panel .messages-intro,
.user-page .messages-panel .user-intro,
.user-page .messages-panel .user-intro.messages-intro {
  max-width: 680px !important;
  margin: 0 0 38px !important;
  font-size: 0.95rem !important;
  line-height: 1.65 !important;
  opacity: 0.66 !important;
}

/* Cápsula cuando aún no hay conversaciones */
.user-page .messages-panel .empty-state {
  width: min(720px, 100%) !important;
  margin: 0 !important;
  padding: 30px 34px !important;
  border-radius: 30px !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.18) !important;
}

.user-page .messages-panel .empty-state h2 {
  margin: 0 0 13px !important;
  font-size: clamp(1.28rem, 2.1vw, 1.8rem) !important;
  line-height: 1.18 !important;
  letter-spacing: -0.035em !important;
  font-weight: 600 !important;
}

.user-page .messages-panel .empty-state p {
  max-width: 650px !important;
  margin: 0 !important;
  font-size: 0.94rem !important;
  line-height: 1.65 !important;
  opacity: 0.72 !important;
}

/* Botón dentro de la cápsula */
.user-page .messages-panel .proposal-actions {
  margin-top: 24px !important;
}

.user-page .messages-panel .proposal-actions a,
.user-page .messages-panel .proposal-actions a.btn-primary,
.user-page .messages-panel .proposal-actions .proposal-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-height: 40px !important;
  padding: 11px 19px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: #b9acd9 !important;
  color: #211c2b !important;
  text-decoration: none !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  transition: background 0.2s ease, transform 0.2s ease;
}

.user-page .messages-panel .proposal-actions a:hover,
.user-page .messages-panel .proposal-actions a.btn-primary:hover,
.user-page .messages-panel .proposal-actions .proposal-link:hover {
  background: #d8dcff !important;
  color: #181818 !important;
  transform: translateY(-1px) !important;
}

/* Cápsula para la bandeja cuando sí haya conversaciones */
.user-page .messages-panel .messages-list {
  width: min(720px, 100%) !important;
  max-width: 720px !important;
  display: grid !important;
  gap: 0 !important;
  padding: 10px !important;
  border-radius: 30px !important;
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.18) !important;
  overflow: hidden !important;
}

.user-page .messages-panel .messages-card {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
  padding: 15px 16px !important;
  border-radius: 22px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
  overflow: hidden !important;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.user-page .messages-panel .messages-card + .messages-card {
  margin-top: 4px !important;
}

.user-page .messages-panel .messages-card:hover {
  transform: translateY(-1px) !important;
  background: rgba(255, 255, 255, 0.065) !important;
  border-color: rgba(185, 172, 217, 0.30) !important;
}

.user-page .messages-panel .messages-avatar,
.user-page .messages-panel .messages-avatar img {
  width: 50px !important;
  height: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  min-height: 50px !important;
  max-height: 50px !important;
  flex: 0 0 50px !important;
  border-radius: 50% !important;
}

.user-page .messages-panel .messages-topline {
  margin-bottom: 4px !important;
}

.user-page .messages-panel .messages-topline h2 {
  margin: 0 !important;
  font-size: 0.98rem !important;
  line-height: 1.25 !important;
  letter-spacing: -0.02em !important;
  font-weight: 600 !important;
}

.user-page .messages-panel .messages-preview {
  margin: 0 !important;
  font-size: 0.86rem !important;
  line-height: 1.45 !important;
  opacity: 0.68 !important;
}

.user-page .messages-panel .messages-date {
  margin: 4px 0 0 !important;
  font-size: 0.72rem !important;
  line-height: 1.3 !important;
  opacity: 0.43 !important;
}

/* Modo claro */
body.light-mode .user-page .messages-panel .empty-state,
html.light-mode body .user-page .messages-panel .empty-state,
body.light-mode .user-page .messages-panel .messages-list,
html.light-mode body .user-page .messages-panel .messages-list {
  background: rgba(255, 255, 255, 0.64) !important;
  border-color: rgba(80, 70, 110, 0.13) !important;
  box-shadow: 0 22px 60px rgba(80, 70, 110, 0.10) !important;
}

body.light-mode .user-page .messages-panel .messages-card:hover,
html.light-mode body .user-page .messages-panel .messages-card:hover {
  background: rgba(80, 70, 110, 0.055) !important;
  border-color: rgba(158, 138, 203, 0.26) !important;
}

body.light-mode .user-page .messages-panel .proposal-actions a,
html.light-mode body .user-page .messages-panel .proposal-actions a {
  background: #9e8acb !important;
  color: #ffffff !important;
}

body.light-mode .user-page .messages-panel .proposal-actions a:hover,
html.light-mode body .user-page .messages-panel .proposal-actions a:hover {
  background: #8b75bd !important;
  color: #ffffff !important;
}

/* Móvil */
@media screen and (max-width: 800px) {
  .user-page .messages-panel h1,
  .user-page .messages-panel .messages-title,
  main.user-page .messages-panel h1.messages-title {
    font-size: 2rem !important;
    line-height: 1.1 !important;
    letter-spacing: -0.04em !important;
  }

  .user-page .messages-panel .messages-intro,
  .user-page .messages-panel .user-intro,
  .user-page .messages-panel .user-intro.messages-intro {
    font-size: 0.9rem !important;
    margin-bottom: 28px !important;
  }

  .user-page .messages-panel .empty-state,
  .user-page .messages-panel .messages-list {
    width: 100% !important;
    padding: 22px !important;
    border-radius: 25px !important;
  }

  .user-page .messages-panel .empty-state h2 {
    font-size: 1.35rem !important;
  }

  .user-page .messages-panel .empty-state p {
    font-size: 0.9rem !important;
  }

  .user-page .messages-panel .proposal-actions a,
  .user-page .messages-panel .proposal-actions a.btn-primary,
  .user-page .messages-panel .proposal-actions .proposal-link {
    width: 100% !important;
  }

  .user-page .messages-panel .messages-list {
    padding: 8px !important;
  }

  .user-page .messages-panel .messages-card {
    padding: 13px !important;
    gap: 12px !important;
    border-radius: 20px !important;
  }

  .user-page .messages-panel .messages-preview {
    white-space: normal !important;
  }
}

/* =========================================================
   Chat · ultra fino y sofisticado
   Bandas de mensaje a línea completa, suaves y discretas
   Mantener este bloque al final del archivo.
   ========================================================= */

.chat-panel {
  width: min(760px, 100%) !important;
  margin: 0 auto !important;
}

.chat-header-soft {
  width: min(640px, 100%) !important;
  margin: 0 auto 20px !important;
  align-items: center !important;
}

.chat-header-soft .section-label {
  font-size: 0.7rem !important;
  letter-spacing: 0.16em !important;
  font-weight: 500 !important;
  opacity: 0.54 !important;
}

.chat-user-photo,
.chat-user-photo-link {
  width: 52px !important;
  height: 52px !important;
}

.chat-user-photo {
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}

/* Contenedor general más editorial, menos "app de chat" */
.chat-capsule {
  width: min(640px, 100%) !important;
  margin: 20px auto 0 !important;
  padding: 14px !important;
  border-radius: 30px !important;
  background: rgba(255, 255, 255, 0.038) !important;
  border: 1px solid rgba(255, 255, 255, 0.085) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.14) !important;
}

body.light-mode .chat-capsule,
html.light-mode body .chat-capsule {
  background: rgba(255, 255, 255, 0.48) !important;
  border-color: rgba(72, 58, 98, 0.075) !important;
  box-shadow: 0 18px 44px rgba(72, 58, 98, 0.055) !important;
}

.chat-box {
  height: 520px !important;
  max-height: 520px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin-top: 0 !important;
  padding: 4px 5px 8px !important;
  scroll-behavior: smooth !important;
}

.chat-messages {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 4px 0 2px !important;
}

/* Cada mensaje ocupa toda la línea */
.chat-message,
.chat-message.is-mine,
.chat-message.is-theirs {
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  text-align: left !important;
}

/* Bandas de mensaje finas */
.chat-message-bubble,
.chat-message.is-mine .chat-message-bubble,
.chat-message.is-theirs .chat-message-bubble,
body.dark-mode .chat-message.is-mine .chat-message-bubble,
body.dark-mode .chat-message.is-theirs .chat-message-bubble {
  width: 100% !important;
  max-width: 100% !important;
  min-height: auto !important;
  padding: 9px 14px !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  border: 1px solid transparent !important;
}

/* Tipografía del mensaje más pequeña y compacta */
.chat-message-bubble p,
.chat-message.is-mine .chat-message-bubble p,
.chat-message.is-theirs .chat-message-bubble p,
body.dark-mode .chat-message.is-mine .chat-message-bubble p,
body.dark-mode .chat-message.is-theirs .chat-message-bubble p {
  margin: 0 !important;
  font-size: 0.835rem !important;
  line-height: 1.31 !important;
  font-weight: 400 !important;
  letter-spacing: 0.002em !important;
}

/* Propio: lila grisáceo, muy translúcido */
.chat-message.is-mine .chat-message-bubble,
body.dark-mode .chat-message.is-mine .chat-message-bubble {
  background: rgba(185, 172, 217, 0.24) !important;
  border-color: rgba(185, 172, 217, 0.105) !important;
  color: rgba(246, 244, 250, 0.84) !important;
}

.chat-message.is-mine .chat-message-bubble,
.chat-message.is-mine .chat-message-bubble *,
.chat-message.is-mine .chat-message-bubble p,
body.dark-mode .chat-message.is-mine .chat-message-bubble,
body.dark-mode .chat-message.is-mine .chat-message-bubble *,
body.dark-mode .chat-message.is-mine .chat-message-bubble p {
  color: rgba(246, 244, 250, 0.84) !important;
}

/* Otra persona: salvia grisácea, todavía más sutil */
.chat-message.is-theirs .chat-message-bubble,
body.dark-mode .chat-message.is-theirs .chat-message-bubble {
  background: rgba(184, 199, 178, 0.18) !important;
  border-color: rgba(184, 199, 178, 0.09) !important;
  color: rgba(244, 246, 243, 0.8) !important;
}

.chat-message.is-theirs .chat-message-bubble,
.chat-message.is-theirs .chat-message-bubble *,
.chat-message.is-theirs .chat-message-bubble p,
body.dark-mode .chat-message.is-theirs .chat-message-bubble,
body.dark-mode .chat-message.is-theirs .chat-message-bubble *,
body.dark-mode .chat-message.is-theirs .chat-message-bubble p {
  color: rgba(244, 246, 243, 0.8) !important;
}

/* Modo claro: elegante, cálido y muy suave */
body.light-mode .chat-message.is-mine .chat-message-bubble,
html.light-mode body .chat-message.is-mine .chat-message-bubble {
  background: rgba(207, 198, 232, 0.34) !important;
  border-color: rgba(143, 122, 186, 0.105) !important;
}

body.light-mode .chat-message.is-theirs .chat-message-bubble,
html.light-mode body .chat-message.is-theirs .chat-message-bubble {
  background: rgba(213, 222, 208, 0.42) !important;
  border-color: rgba(132, 152, 126, 0.09) !important;
}

body.light-mode .chat-message.is-mine .chat-message-bubble,
body.light-mode .chat-message.is-mine .chat-message-bubble *,
body.light-mode .chat-message.is-mine .chat-message-bubble p,
html.light-mode body .chat-message.is-mine .chat-message-bubble,
html.light-mode body .chat-message.is-mine .chat-message-bubble *,
html.light-mode body .chat-message.is-mine .chat-message-bubble p,
body.light-mode .chat-message.is-theirs .chat-message-bubble,
body.light-mode .chat-message.is-theirs .chat-message-bubble *,
body.light-mode .chat-message.is-theirs .chat-message-bubble p,
html.light-mode body .chat-message.is-theirs .chat-message-bubble,
html.light-mode body .chat-message.is-theirs .chat-message-bubble *,
html.light-mode body .chat-message.is-theirs .chat-message-bubble p {
  color: rgba(28, 27, 30, 0.76) !important;
}

/* Meta casi susurrada */
.chat-message-meta {
  margin: 2px 5px 1px !important;
  font-size: 0.59rem !important;
  line-height: 1.22 !important;
  opacity: 0.25 !important;
  letter-spacing: 0.01em !important;
}

.chat-message.is-mine .chat-message-meta {
  text-align: right !important;
}

.chat-message.is-theirs .chat-message-meta {
  text-align: left !important;
}

body.light-mode .chat-message-meta,
html.light-mode body .chat-message-meta {
  opacity: 0.36 !important;
}

/* Scrollbar menos presente */
.chat-box::-webkit-scrollbar {
  width: 7px !important;
}

.chat-box::-webkit-scrollbar-track {
  background: transparent !important;
  border-radius: 999px !important;
}

.chat-box::-webkit-scrollbar-thumb {
  background: rgba(185, 172, 217, 0.24) !important;
  border-radius: 999px !important;
}

.chat-box::-webkit-scrollbar-thumb:hover {
  background: rgba(185, 172, 217, 0.42) !important;
}

body.light-mode .chat-box::-webkit-scrollbar-thumb,
html.light-mode body .chat-box::-webkit-scrollbar-thumb {
  background: rgba(143, 122, 186, 0.24) !important;
}

body.light-mode .chat-box::-webkit-scrollbar-thumb:hover,
html.light-mode body .chat-box::-webkit-scrollbar-thumb:hover {
  background: rgba(143, 122, 186, 0.4) !important;
}

/* Formulario más silencioso y alineado con el chat */
.chat-form {
  width: min(640px, 100%) !important;
  margin: 20px auto 0 !important;
  padding: 16px !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.038) !important;
  border: 1px solid rgba(255, 255, 255, 0.085) !important;
  box-shadow: none !important;
}

.chat-form label {
  font-size: 0.78rem !important;
  line-height: 1.2 !important;
  opacity: 0.58 !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
}

.chat-form textarea {
  min-height: 92px !important;
  max-height: 160px !important;
  padding: 13px 14px !important;
  border-radius: 16px !important;
  font-size: 0.86rem !important;
  line-height: 1.38 !important;
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  box-shadow: none !important;
}

.chat-form textarea:focus {
  border-color: rgba(185, 172, 217, 0.34) !important;
  box-shadow: 0 0 0 3px rgba(185, 172, 217, 0.08) !important;
}

body.light-mode .chat-form,
html.light-mode body .chat-form {
  background: rgba(255, 255, 255, 0.44) !important;
  border-color: rgba(72, 58, 98, 0.075) !important;
}

body.light-mode .chat-form textarea,
html.light-mode body .chat-form textarea {
  background: rgba(255, 255, 255, 0.58) !important;
  border-color: rgba(72, 58, 98, 0.105) !important;
}

/* Botón algo menos protagonista */
.chat-form button,
.chat-form .btn-primary,
body.dark-mode .chat-form button,
body.dark-mode .chat-form .btn-primary,
body.light-mode .chat-form button,
body.light-mode .chat-form .btn-primary,
html.light-mode body .chat-form button,
html.light-mode body .chat-form .btn-primary {
  min-height: 40px !important;
  padding: 11px 18px !important;
  border-radius: 999px !important;
  background: rgba(158, 138, 203, 0.88) !important;
  color: #ffffff !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.chat-form button:hover,
.chat-form .btn-primary:hover,
body.dark-mode .chat-form button:hover,
body.dark-mode .chat-form .btn-primary:hover,
body.light-mode .chat-form button:hover,
body.light-mode .chat-form .btn-primary:hover,
html.light-mode body .chat-form button:hover,
html.light-mode body .chat-form .btn-primary:hover {
  background: rgba(139, 117, 189, 0.95) !important;
  transform: translateY(-1px) !important;
}

/* Enlaces inferiores más discretos */
.chat-secondary-actions {
  width: min(640px, 100%) !important;
  margin: 16px auto 0 !important;
  font-size: 0.82rem !important;
  opacity: 0.68 !important;
}

.chat-secondary-actions a {
  font-size: 0.82rem !important;
  opacity: 0.7 !important;
}

.chat-secondary-actions a:hover {
  opacity: 1 !important;
}

/* Móvil */
@media (max-width: 720px) {
  .chat-header-soft {
    width: 100% !important;
    margin-bottom: 18px !important;
  }

  .chat-capsule,
  .chat-form,
  .chat-secondary-actions {
    width: 100% !important;
  }

  .chat-capsule {
    padding: 10px !important;
    border-radius: 24px !important;
  }

  .chat-box {
    height: 430px !important;
    max-height: 430px !important;
    padding: 3px 4px 7px !important;
  }

  .chat-messages {
    gap: 6px !important;
  }

  .chat-message-bubble,
  .chat-message.is-mine .chat-message-bubble,
  .chat-message.is-theirs .chat-message-bubble {
    padding: 8px 11px !important;
    border-radius: 14px !important;
  }

  .chat-message-bubble p,
  .chat-message.is-mine .chat-message-bubble p,
  .chat-message.is-theirs .chat-message-bubble p {
    font-size: 0.815rem !important;
    line-height: 1.29 !important;
  }

  .chat-message-meta {
    font-size: 0.57rem !important;
    margin-top: 2px !important;
  }

  .chat-form {
    padding: 14px !important;
    border-radius: 22px !important;
  }

  .chat-form textarea {
    min-height: 86px !important;
  }
}
